ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro to go quickly to a sheet (https://www.excelbanter.com/excel-programming/342273-macro-go-quickly-sheet.html)

Darin Kramer

Macro to go quickly to a sheet
 

Hi there,


I have about 40 sheets in a book. I need to quickly navigate to a sheet
by being able to enter the sheet name and then i want Excel to take me
to that sheet.
(i dont want to create a long list of hyperlinked names - would rather
run a macro that asks me what sheet I want to goto and takes me there...
or perhaps gotospecial command...?

Any ideas...

Many thanks

D


*** Sent via Developersdex http://www.developersdex.com ***

Bruno Campanini[_3_]

Macro to go quickly to a sheet
 
"Darin Kramer" wrote in message
...

Hi there,


I have about 40 sheets in a book. I need to quickly navigate to a sheet
by being able to enter the sheet name and then i want Excel to take me
to that sheet.
(i dont want to create a long list of hyperlinked names - would rather
run a macro that asks me what sheet I want to goto and takes me there...
or perhaps gotospecial command...?

Any ideas...


Try this code:
--------------------------------
Sub Button10_Click()
Dim SheetName As String

SheetName = InputBox("Sheet to be activated")
If SheetName = "" Then
Exit Sub
Else
ThisWorkbook.Sheets(SheetName).Activate
End If

End Sub
---------------------------

Bruno



Darin Kramer

Macro to go quickly to a sheet
 
Bruno, Thanks a Million - works perfectly!!!



*** Sent via Developersdex http://www.developersdex.com ***

Ron de Bruin

Macro to go quickly to a sheet
 
Hi Darin

Why don't you right click in the arrows on the left of the first tab

Or use this macro

Sub SheetList_CP()
'Chip Pearson, 2002-10-29, misc., %23ByZYZ3fCHA.1308%40tkmsftngp11
'Dave Peterson, same date/thread, 3DBF0BA8.4DAE9DA0%40msn.com
On Error Resume Next
Application.CommandBars("Workbook Tabs").Controls("More Sheets...").Execute
If Err.Number 0 Then
Err.Clear
Application.CommandBars("Workbook Tabs").ShowPopup
End If
On Error GoTo 0
End Sub



--
Regards Ron de Bruin
http://www.rondebruin.nl


"Darin Kramer" wrote in message ...
Bruno, Thanks a Million - works perfectly!!!



*** Sent via Developersdex http://www.developersdex.com ***




GB

Macro to go quickly to a sheet
 
I've also previously used a form that populates with the list of worksheets,
as each worksheet is selected in the form, the sheet appears behind the
non-modal form. (Non-modal for us Excel VBA folks.)

Additionally, the rough method provided, by at least one individual does no
verification that the page name is typed correctly, and will crash if the
worksheet is not present. But afterall you asked only how to, you didn't ask
to try to make it "dumby" proof. :)

"Darin Kramer" wrote:


Hi there,


I have about 40 sheets in a book. I need to quickly navigate to a sheet
by being able to enter the sheet name and then i want Excel to take me
to that sheet.
(i dont want to create a long list of hyperlinked names - would rather
run a macro that asks me what sheet I want to goto and takes me there...
or perhaps gotospecial command...?

Any ideas...

Many thanks

D


*** Sent via Developersdex http://www.developersdex.com ***



All times are GMT +1. The time now is 01:06 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com