I am trying to figure out why I get the above error at times when using the range method. The simplest I can get is the following code:
If the button in question is on Sheet1, I get the following error:Private Sub CommandButton1_Click() Worksheets("Sheet2").Range("A1").Activate End Sub
Run-time error '1004':
Activate method of Range class failed
Can anyone explain what causes the error to pop up?
Thanks!
You can't activate a range an inactive sheet. You can do this:
Application.GoTo Worksheets("Sheet2").Range("A1")
Microsoft MVP - Excel
Entia non sunt multiplicanda sine necessitate
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks