I am trying to clear a range by selecting it thru a variable. when I get to the line which reads Range (tiledbrange) select I get :
runtime error 1004
Method 'range' of object '_global' failed.
The range is defined in the excel spreadsheet and is of the nature offset(ref,rows,columns,height,width) and is therefore variable in size. I have worked with Excel for 5 years but am new to VB and VBA. How do I determine what is going wrong?
runtime error 1004
Method 'range' of object '_global' failed.
The range is defined in the excel spreadsheet and is of the nature offset(ref,rows,columns,height,width) and is therefore variable in size. I have worked with Excel for 5 years but am new to VB and VBA. How do I determine what is going wrong?
Code:
Public clearrange As String
Sub update_Tile_Data()
clearrange = "tiledbrange"
Call Clear_Range(clearrange)
....other stuff...
End Sub
Sub Clear_Range(clearrange)
Range(tiledbrange).Select ' <--Error occurs here
Selection.ClearContents
End Sub