Select a sheet and return

  • Thread starter Thread starter Patrick C. Simonds
  • Start date Start date
P

Patrick C. Simonds

I need something that will select cell A1 on the sheet named Holiday and
then return me to the sheet that was active when the code was run. It must
go to and select A1 on the Holiday sheet,
 
This macro will do what you asked...

Sub SelectA1OnHolidaySheet()
Dim WS As Worksheet
Set WS = ActiveSheet
On Error GoTo CleanUp
Application.ScreenUpdating = False
Worksheets("Holiday").Activate
Worksheets("Holiday").Range("A1").Select
WS.Activate
CleanUp:
Application.ScreenUpdating = True
End Sub

But I am curious... why do you think you need to do this?
 
I know that, which is why I asked the OP the question...

"But I am curious... why do you think you need to do this?"
 
Could be the OP was trying to do the select in one line without first
activating the sheet and kept getting an error message. Probably just wanted
to know how to get it to select A1 from another sheet.
 

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