"Select" and "Activate" failing?

  • Thread starter Thread starter Ed
  • Start date Start date
E

Ed

I have a Workbook_Open macro as follows:

Private Sub Workbook_Open()

Worksheets("Sheet2").Visible = True
Worksheets("Sheet3").Visible = xlVeryHidden
Worksheets("Sheet1").Visible = True
Worksheets("Sheet1").Range("A1").Select

End Sub

The last line fails with " "Select" method of "Range" class failed." I then
changed it to
Worksheets("Sheet1").Range("A1").Activate
and got the same failure error. Why?

Ed
 
I don't know why but the work around I use is:
Application.GoTo Sheets("Sheet1").Range("A1")

Charles
 
or you can use the following two lines

Worksheets("Sheet1").activate
Worksheets("Sheet1").Range("A1").Select

You can not select a range unless that sheet is already
activated(selected)

Hope this helps.
 

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

Back
Top