Sheet Navigation

A

ajw150

Hi,

I have been looking around the forums but cant find much to assist
Please can you help.

I have a wide selection of sheets and would like the user to be able t
click onto them whenever he/she decides. How is this done? VBA?

Thanks

Andre

Attachment filename: test navigation.xls
Download attachment: http://www.excelforum.com/attachment.php?postid=55558
 
J

John P

You could try naming areas of the sheet by highlighting a cell or group of
cells and then naming it/them by clicking in the name box?

Cheers from North Yorkshire UK


John
 
V

vikram

what u can do is on that specific cell---do a right click , choos
insert hyperlink and then on the icons coming on the left side ,clic
on the place in this folder document----and specify a cell number lik
B50

what will happen is if someone clicks tht cell it will take him to cel
B5
 
A

ajw150

I was hoping to be able to list the titles in a dropdown box of som
sort, to make it look neater, and then allow the user to click on tha
link. They then get taken to the sheet.

Andre
 
D

Dave Peterson

I clicked on it and it took me to that thread in google.

Here's a copy of the post:

How about a floating toolbar that displays all the worksheet names?

The default behavior when you type into the combobox on that toolbar is to match
the entries.


Option Explicit
Sub auto_close()
On Error Resume Next
Application.CommandBars("MyNavigator").Delete
On Error GoTo 0
End Sub

Sub auto_open()

Dim cb As CommandBar
Dim ctrl As CommandBarControl
Dim wks As Worksheet

On Error Resume Next
Application.CommandBars("MyNavigator").Delete
On Error GoTo 0

Set cb = Application.CommandBars.Add(Name:="myNavigator", temporary:=True)
With cb
.Visible = True
Set ctrl = .Controls.Add(Type:=msoControlButton, temporary:=True)
With ctrl
.Style = msoButtonCaption
.Caption = "Refresh Worksheet List"
.OnAction = ThisWorkbook.Name & "!refreshthesheets"
End With

Set ctrl = .Controls.Add(Type:=msoControlComboBox, temporary:=True)
With ctrl
.Width = 300
.AddItem "Click Refresh First"
.OnAction = ThisWorkbook.Name & "!changethesheet"
.Tag = "__wksnames__"
End With
End With

End Sub
Sub ChangeTheSheet()

Dim myWksName As String
Dim wks As Worksheet

With Application.CommandBars.ActionControl
If .ListIndex = 0 Then
MsgBox "Please select an existing sheet"
Exit Sub
Else
myWksName = .List(.ListIndex)
End If
End With

Set wks = Nothing
On Error Resume Next
Set wks = Worksheets(myWksName)
On Error GoTo 0

If wks Is Nothing Then
Call RefreshTheSheets
MsgBox "Please try again"
Else
wks.Select
End If

End Sub
Sub RefreshTheSheets()
Dim ctrl As CommandBarControl
Dim wks As Worksheet

Set ctrl = Application.CommandBars("myNavigator") _
.FindControl(Tag:="__wksnames__")
ctrl.Clear

For Each wks In ActiveWorkbook.Worksheets
ctrl.AddItem wks.Name
Next wks
End Sub


If you swap workbooks, just click the other button to get a fresh list of
worksheet names in the dropdown.


If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm
 

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