Select method of range class failed problem

R

Raj

Hi,

I have the following code in the Masterdata Worksheet_activate event.
I want Range a1 to be selected when the worksheet is activated:

Private Sub Worksheet_Activate()
ActiveWindow.DisplayGridlines = False
Worksheets("Masterdata").Range("a1").Select
ActiveWindow.Zoom = 85
End Sub

I get error "select method of range class failed" . Please help.

Thanks in advance.
Regards,
Raj
 
R

Ron Coderre

Try this:

Private Sub Worksheet_Activate()
Range("a1").Select
With ActiveWindow
.DisplayGridlines = False
.Zoom = 85
End With
End Sub

Does that help?
Post back if you have more questions.

Regards,

Ron
Microsoft MVP - Excel
 

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