Return User to Last Active Worksheet

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Howdy,

Here is my issue. I have workbook with 30 some odd sheets in it. Each sheet
has a button that sends the user to a "Specs Sheet" that has all the averages
on it. What I need to know, is what code is needed for a button to send the
user to the last active worksheet that he or she was on. Any help is
appreciated. Sorry I don't have a code, I really never have come across an
issue of this type.
 
Create a public variable and save the worksheet name when that button is
hit. Then just pick up that value when you need to return.

Public SheetName As String

Public Sub SpecsSheet()

SheetName = Activesheet.Name
Worksheets("Specs Sheet").Activate
End Sub

Public Sub Return()
Worksheets(SheetName).Activate
End Sub

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 

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