go to sheet number

J

John

Errors are given in sheet numbers but the sheets have names not numbers.

How do you "go to" a sheet number? I have about 200 in a workbook.

Thanks
John
 
C

Chip Pearson

You can access a sheet by its position number. E.g.,

Sheets(10).Activate


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 
J

John

I didn't mean in vb. I'm in the workbook and want to go to sheet #32 but
the sheets only have names on them... no numbers.

Thanks
John
 
C

Chip Pearson

There is no way to go to a sheet based on its index number
without using VBA or manually counting over that many sheets.

You could use the following macro and assign it to a shortcut
key.

Sub GoToSheetNumber()
Dim N As Long
N = Application.InputBox(prompt:="Enter a sheet number",
Type:=1)
If N < 1 Or N > Sheets.Count Then
MsgBox "Invalid sheet number"
Else
Sheets(N).Select
End If
End Sub




--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 
J

John

They are listed in the project window in vb thank God and easy to select
and go to. It also lists there all your vb modules but, of course, by
number not name. It's as if the designers purposely made it as obscure
as possible navigating around your workbooks.

I exported all my modules and renamed them and loaded them again so I
could identify them easily. MS promptly renamed them by module numbers.

John
 
S

SteveW

They are listed in the project window in vb thank God and easy to select
and go to. It also lists there all your vb modules but, of course, by
number not name. It's as if the designers purposely made it as obscure
as possible navigating around your workbooks.

I exported all my modules and renamed them and loaded them again so I
could identify them easily. MS promptly renamed them by module numbers..

You can just rename them - F4 - alter properties
 

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