excel multilple sheets

A

Arr

Need to branch to another sheet in the workbook and then return to the
sheet that the branch was started from!

Now for the kicker

The user can change the name of the sheet that the program runs from!!
 
E

Earl Kiosterud

Arr,

Put this in a module:

Dim SheetReturn As String

Sub GotoSheet()
SheetReturn = ActiveSheet.Name ' save current sheet name
Sheets("Sheet2").Select
End Sub

Sub GoBackSheet()
If SheetReturn <> "" Then Sheets(SheetReturn).Select
SheetReturn = ""
End Sub

Run the macros from the respective sheets.
 

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