Link to home
Start Free TrialLog in
Avatar of Geekamo
GeekamoFlag for United States of America

asked on

Macro Code Revision - Go to specific cell on open

Hello Experts,

I am currently using this code in my workbook.

Private Sub Workbook_Open()
Sheets("Measuring Up").Range("N27") = "Diameter"
End Sub

In addition to that, I want the active cell to always go to the name range "Start". So anytime the workbook is opened, it's always on a specific cell - which is the named range of "Start".

I thought the code would be something like,...

Private Sub Workbook_Open()
Sheets("Measuring Up").Range("N27") = "Diameter"
Application.Goto Reference:="Start"
End Sub

But that doesn't work, cause clearly I don't know what I'm doing. :)

Any suggestions?

Thank you in advance for your help!

~ Geekamo
Avatar of Saqib Husain
Saqib Husain
Flag of Pakistan image

Sheets("Measuring Up").Range("start").select
ASKER CERTIFIED SOLUTION
Avatar of Saqib Husain
Saqib Husain
Flag of Pakistan image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Norie
Norie

The code works fine for me, without a worksheet reference.

What actually happens when you open the workbook?

Do you get an error or does the range not get selected?
What are you trying to do here?


Sheets("Measuring Up").Range("N27") = "Diameter"
Application.Goto Reference:="Start"
Avatar of Geekamo

ASKER

@ ssaqibh,

Your solution worked perfectly.  I am now using this code.

Private Sub Workbook_Open()
Sheets("Measuring Up").Range("N27") = "Diameter"
Sheets("Measuring Up").Activate
Sheets("Measuring Up").Range("Start").Select
End Sub

Thanks!

~ Geekamo