Switching between sheets - shortcut?

Stringt

New Member
Joined
Feb 18, 2002
Messages
35
I often find myself moving from one sheet in a workbook to another over and over. I wanted a shortcut that moved between the last two sheets selected.

Similar to how Alt+Tab works with windows.

Does anybody know a keyboard shortcut or if not is there a macro that could be added to perosnal.xls that would mean i would aways b able to switch between two sheets quickly.

Cheers

Tim
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.

royUK

Well-known Member
Joined
Jul 24, 2002
Messages
1,606
Place an autoshape (perhaps an arrow) and simply insert a hyperlink from the Insert Menu. Choose place in this document. Use the same method to create a Return option.

You can write the name of the sheet that you have hyperlinked to in the arrow by right clicking on the shape and choosing insert text
This message was edited by royUK on 2002-10-07 03:37
 

Stringt

New Member
Joined
Feb 18, 2002
Messages
35
yeah can do for a custom one, but would have to add this onto every sheet I work on.

Wanted to just have a generic keyboard shortcut that I could use in any workbook, that flipped between th current sheet and the last sheet activated.
 

dln

New Member
Joined
Sep 20, 2002
Messages
14
-"Just like Windows" (under Windows)

Try Ctrl+Tab.
Unfortunately it operates a round-robin system, so if you have more than two wkb open it will move to the third upon second execution - in which case, use Ctrl+Shift+Tab to return to wkb1.

Regards,
=dn
 

Stringt

New Member
Joined
Feb 18, 2002
Messages
35

ADVERTISEMENT

sorry... i want to switch between work sheets - not work books.
 

royUK

Well-known Member
Joined
Jul 24, 2002
Messages
1,606
If you use the asap addin ( http://www.asap-utilities.com) you can create an index page with hyperlinks to all pages in the workbook. You could set up so that this sheet is always on view by using the Arrange Windows option. You could then have a narrow window to the left of your screen with all Sheet Index on view
This message was edited by royUK on 2002-10-07 04:26
 

dmckinney

Board Regular
Joined
Jul 10, 2002
Messages
120

ADVERTISEMENT

Hi,

This code written in haste - so might need a little debugging.

I guess you want to attach it to a .xla , so that's it's available to all workbooks.

Regards,

Dave.

Code:
Sub movesheet()
    Dim asi As Integer
    asi = ActiveSheet.Index
    Select Case asi
        Case ActiveWorkbook.Sheets.Count
            ActiveWorkbook.Sheets(1).Activate
        Case Else
            ActiveWorkbook.Sheets(asi + 1).Activate
    End Select
    
    
End Sub
 

Stringt

New Member
Joined
Feb 18, 2002
Messages
35
thanks. but this seems to just move through sheets in order... like the Ctrl+Page Down shortcut.

Is there any way it can know which sheet you came from and go ck to it?
 

dmckinney

Board Regular
Joined
Jul 10, 2002
Messages
120
Sorry I didn't read your post properly.

The code below will toggle between selected sheets. (Selected with ctrl or shift).

This will work so long as not all the sheets are selected, (in which case use my previous code.)

Regards,

Dave.

Code:
Sub togglebetweenselected()
    Dim mywks As Worksheet
    Dim strLastWorksheet As String
    
    For Each mywks In ActiveWindow.SelectedSheets
        If strLastWorksheet = ActiveSheet.Name Then
            mywks.Activate
            Exit Sub
        End If
        strLastWorksheet = mywks.Name
    Next

    ' This is where the last selected is the last sheet - so activate the first sheet.
    ActiveWindow.SelectedSheets(1).Activate
    
End Sub
 

Forum statistics

Threads
1,143,739
Messages
5,720,578
Members
422,292
Latest member
Bernd0501

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top