vb newbie here, I have a private macro saved in thisworkbook in the .xlsb file, the code works fine if data is in the document but if the cell is blank or has other data when opening up other excel documents I get run-time error '1004': method 'range" of object'_global falied . I can click on end and im in my excel document. I cant figure out how to exclude anything but "history" or "ItemBrowse"
any thoughts would be helpful. I also tried if statements and the same error but will work it the data is in the cell
(my code below)
any thoughts would be helpful. I also tried if statements and the same error but will work it the data is in the cell
(my code below)
Code:
Private Sub Workbook_Open()
Select Case Range("a3")
Case "History"
'History_Order_Guide_Without_Pricing2
'code to do something
Case "ItemBrowse"
Order_Guide_With_Pricing2
'code for something else
Case Else
End Select
End Sub
Last edited by a moderator: