Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I know the shortcut CRTL + page up/down but I need the similar function that exists eg in internet explorer: Shift + alt I found a macro that is close but does not entirely solve the problem:

If ActiveSheet.Name = "To Do" Then Sheets("Budget").Activate ElseIf ActiveSheet.Name = "Budget" Then Sheets("To Do").Activate

I can name the A1 cell with the sheet name and use search (f5) and type the name, but this is to cumbersome.

Any ideas, guys?

share|improve this question

2 Answers 2

Dan's solution works. If you don't want to store the LastSheet in a cell range try:

 Private Sub Workbook_SheetDeactivate(ByVal Sh As Object)
  ActiveWorkbook.Names.Add Name:="whchSheet", RefersToR1C1:=Sh.Name
 End Sub

still create a hotkey as he suggests

 Sub MoveToLastSheet()
  Sheets(Application.Evaluate(Names("whchSheet").Value)).Select
 End Sub
share|improve this answer

If you would like to add a hotkey to switch to your previous sheet, first create a cell called "LastSheet" somewhere to store the value of the last sheet. Then place this in your ThisWorkbook:

Private Sub Workbook_SheetDeactivate(ByVal Sh As Object)
Range("LastSheet").Value = Sh.Name
End Sub

Now, in Module1 place this code:

Sub MoveToLastSheet()
Sheets(Range("LastSheet").Value).Select
End Sub

Create a hotkey for the MoveToLastSheet Macro, and you are done. This will now take you to the previous sheet you visited.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.