Sheet navigation, if there isn't hotkey for "go to first sheet"?

  • Thread starter StargateFanNotAtHome
  • Start date
S

StargateFanNotAtHome

I know that there is Ctrl+PageUp + Ctrl+PageDown to navigation/browse
back and forth in a workbook but couldn't find anything via google re
a hotkey to go to first and last sheets. If there isn't anything,
thought that a macro would do.

If no hotkey, thought that something like this might work:

Sub GOto_First_Sheet_in_Workbook()
Sheets("Worksheets(1)").Activate
End Sub

But I don't know how to type in the generic name for the first sheet.
I believe I've used Worksheets(1) in other cases but this isn't
working here and I can't find what to do to go to the last sheet, also
using a generic term rather than a specific sheet name. This way I
can put this into my PERSONAL.xls.

Thanks! :eek:D
 
I

IanKR

I know that there is Ctrl+PageUp + Ctrl+PageDown to navigation/browse
back and forth in a workbook but couldn't find anything via google re
a hotkey to go to first and last sheets. If there isn't anything,
thought that a macro would do.

If no hotkey, thought that something like this might work:

Sub GOto_First_Sheet_in_Workbook()
Sheets("Worksheets(1)").Activate
End Sub

But I don't know how to type in the generic name for the first sheet.
I believe I've used Worksheets(1) in other cases but this isn't
working here and I can't find what to do to go to the last sheet, also
using a generic term rather than a specific sheet name. This way I
can put this into my PERSONAL.xls.

Sub Goto_Last_Sheet_in_Workbook()
Sheets(Sheets.Count).Activate
End Sub


Sub Goto_First_Sheet_in_Workbook()
Sheets(1).Activate
End Sub
 
A

andy the pugh

Sub GOto_First_Sheet_in_Workbook()
    Sheets("Worksheets(1)").Activate
End Sub

I prefer the Application.Goto method for changing sheet and position
as the scroll option gives better visual feedback

Sub GotoFirst()
Application.Goto Sheets(1).Range("A1")
End Sub

Sub GotoLast()
Application.Goto Sheets(Sheets.Count).Range("A1")
End Sub
 
I

IanKR

... as the scroll option gives better visual feedback

??? I couldn't see any difference, visually.
 
I

IanKR

... as the scroll option gives better visual feedback
??? I couldn't see any difference, visually.

Ah, yes. Err, I forgot the Scroll option.

Application.Goto Sheets(Sheets.Count).Range("A1"), True

Apart for going to cell A1 on the sheet (as opposed to just activating the
sheet) (which is useful, but not necessarily what the OP requested), I still
can't see any difference. Unless I'm missing something mind-bogglingly
obvious.
 

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