Switching to a specific worksheet

  • Thread starter Thread starter JR
  • Start date Start date
J

JR

I'm new to VBA and have a sub that creates a new worksheet with the
name specified in a input box. I would like to switch back to my
original worksheet after the creating the new one and I'm lost. I
would also like to switch to any worksheet just by entering the WS
name in an input box. Appreciate any help.

Thanks
 
Something like:


Dim sSheetNameOriginal As String

sSheetNameOriginal = ActiveSheet.Name

'your code

Sheets(sSheetNameOriginal).Select 'to go back
 

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