dynamic range definition

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.



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:


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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top