- Joined
- May 19, 2010
- Messages
- 7
- Reaction score
- 0
Basically trying to change the borderformat of a row (up to a certain point) by activating a checkbox in that row.
Start1 = "A" & CStr(LRow)
End1 = "AV" & CStr(LRow)
I end up getting the following error code upon execution of the Makro:
"Run-time error '1004'
"Application-defined or object-defined error"
-----
Sincerely yours John
Sub Process_Position()
Dim LCol As Integer
Dim LRow As Integer
Dim BoxNumber As String
LName = Application.Caller
BoxNumber = Mid(LName, 10)
LCol = ActiveSheet.DrawingObjects(LName).TopLeftCell.Column
LRow = ActiveSheet.DrawingObjects(LName).TopLeftCell.Row
Select Case LCol
Case 5
If ActiveSheet.DrawingObjects(LName).Value > 0 Then
ActiveSheet.DrawingObjects("Check Box " & BoxNumber + 1).Value = 0
ActiveSheet.Range("A19:AV19").Select
With Selection.Borders(xlEdgeLeft)
.ColorIndex = 4
.Weight = xlMedium
End With
End If
End Select
End Sub
The statement "ActiveSheet.Range("A19:AV19").Select" works fine, but the moment I try to fill the .Range() part with some something like ("Start1:End1"), where those two variables are defined as Strings and filled in the following way:Dim LCol As Integer
Dim LRow As Integer
Dim BoxNumber As String
LName = Application.Caller
BoxNumber = Mid(LName, 10)
LCol = ActiveSheet.DrawingObjects(LName).TopLeftCell.Column
LRow = ActiveSheet.DrawingObjects(LName).TopLeftCell.Row
Select Case LCol
Case 5
If ActiveSheet.DrawingObjects(LName).Value > 0 Then
ActiveSheet.DrawingObjects("Check Box " & BoxNumber + 1).Value = 0
ActiveSheet.Range("A19:AV19").Select
With Selection.Borders(xlEdgeLeft)
.ColorIndex = 4
.Weight = xlMedium
End With
End If
End Select
End Sub
Start1 = "A" & CStr(LRow)
End1 = "AV" & CStr(LRow)
I end up getting the following error code upon execution of the Makro:
"Run-time error '1004'
"Application-defined or object-defined error"
-----
Sincerely yours John