Shortcut to go to previous worksheet

A

Andy Brown

What is the shortcut key to goto previous WorkSheet?

If you mean the sheet left of the active sheet, CTRL+PageUp. If you mean the
sheet you were looking at before you switched to *this* one, there isn't
one.

Rgds,
Andy
 
A

Andy Brown

Hello David.
Part two isn't entirely correct. If you came to the page via a Hyperlink
....

Of course you are right. Although as a method you'd have to set up the link
in the first place, so I wouldn't necessarily class that a shortcut. Well,
no more than (F5 -- "Sheet1!A1" -- Enter), say. Are we quits on the
"Target.Range("B1")" thing now? <bg>

Rgds,
Andy
 
P

PrakashKC

But I need to know; say for instance I have 30 worksheets and i'm working on the worksheet #1 and then i go to worksheet #25, now what is the shortcut ket to go back to worksheet #1

----- Andy Brown wrote: ----

Hello David
Part two isn't entirely correct. If you came to the page via a Hyperlin
...

Of course you are right. Although as a method you'd have to set up the lin
in the first place, so I wouldn't necessarily class that a shortcut. Well
no more than (F5 -- "Sheet1!A1" -- Enter), say. Are we quits on th
"Target.Range("B1")" thing now? <bg

Rgds
And
 
P

PrakashKC

Thanks for the info, But I need to know; say for instance I have 30 worksheets and i'm working on the worksheet #1 and then i go to worksheet #25, now what is the shortcut ket to go back to worksheet #1
 
A

Andy Brown

Thanks for the info, But I need to know; say for instance I have 30
worksheets and i'm working on the worksheet #1 and then i go to worksheet
#25, now what is the shortcut ket to go back to worksheet #1?

As I ½-suspected. There is no shortcut key for this. You could use code in
the Workbook module, e.g.

Private Sub Workbook_SheetDeactivate(ByVal Sh As Object)
MsgBox "You just left " & Sh.Name
End Sub

will tell you where you just left. How you go about storing this value
somewhere (?in a "variable"?) for later use is beyond me, but someone here
will be able to tell you now you've clarified. Although this thread's a bit
old now, if you don't get an answer in a day or 2 re-post with the
additional info.

Rgds,
Andy
 
D

David McRitchie

For a solution involving how the heck did I get to this sheet, take
me back take a look at
Return to Previously Selected Sheet
http://www.mvps.org/dmcritchie/excel/sheetback.htm

This will go Back and Forward. If you select a sheet that is
your new forward and you can only go back from there. So I
am not including anything to do with hyperlinks.

Only good for the current workbook and you can't have
another workbook using it. (at least not so far).
The following has been briefly tested and then posted on June 04, 2004.
Updates will be made to website.

'---------- the following into ThisWorkBook
Option Explicit
Private Sub Workbook_SheetActivate(ByVal Sh As Object)
'D.McRitchie, 2004-06-04 sheetback.htm
nxtsheets(0) = nxtsheets(0) + 1
nxtsheets(nxtsheets(0)) = ActiveSheet.Name
End Sub

'--------- the following into a regular module (i.e. module1)
'--------- in your workbook
Option Explicit
Public nxtsheets(100) As Variant
Sub BackBy_nxtsheets()
'D.McRitchie, 2004-06-04 sheetback.htm
If nxtsheets(0) < 2 And nxtsheets(100) = "" Then
MsgBox "can't go back via nxtsheets"
Exit Sub
End If
Worksheets(nxtsheets(nxtsheets(0) - 1)).Activate
nxtsheets(0) = nxtsheets(0) - 2
'-- 1 was subtracted from nxtsheets
End Sub

Sub ForwardBy_nxtsheets()
'D.McRitchie, 2004-06-04 sheetback.htm
If nxtsheets(0) = 100 Then nxtsheets(0) = 0
If nxtsheets(nxtsheets(0) + 1) = "" Then
MsgBox "can't go Forward via nxtsheets"
Exit Sub
End If
Worksheets(nxtsheets(nxtsheets(0) + 1)).Activate
'-- 1 was added to nxtsheets
End Sub
---HTH, David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]My Excel Pages:
http://www.mvps.org/dmcritchie/excel/excel.htmSearch Page: http://www.mvps.org/dmcritchie/excel/search.htm "Andy Brown"
 
Top