LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Navigation Command Bar


This code puts a navigation bar in your workbook to easily navigat
between sheets. I found it at a site. The command bar opens when I pu
the code under workbook in VBA. Only I am not an expert and do no
really understand what to edit before I get it to work in my workbook
Can someone help me with this ??


Navigation Command Bar:

Private Sub Workbook_Open()
On Error Resume Next
Application.CommandBars("Navigate").Delete
On Error GoTo 0

With Application.CommandBars.Add("Navigate XL-Dennis", , False, True)

With .Controls.Add(msoControlButton)
.TooltipText = "Move Back"
.FaceId = 1017
.OnAction = "Move_Back"
.BeginGroup = True
End With

With .Controls.Add(msoControlDropdown)
.AddItem "Sheet1"
.AddItem "Sheet2"
.AddItem "Sheet3"
.TooltipText = "SheetNavigate"
.OnAction = "Sheet_Navigate"
End With

With .Controls.Add(msoControlButton)
.TooltipText = "Move next"
.FaceId = 1018
.OnAction = "Move_Next"
End With

.Protection = msoBarNoCustomize
.Position = msoBarFloating
.Visible = True
End With
End Sub



Private Sub Sheet_Navigate()
Dim stActiveSheet As String

With CommandBars.ActionControl
stActiveSheet = .List(.ListIndex)
End With

Select Case stActiveSheet
Case "Sheet1"
Worksheets("Shee1").Activate
Case "Sheet2"
Worksheets("Sheet2").Activate
Case "Sheet3"
Worksheets("Sheet3").Activate
End Select
End Sub

Private Sub Move_Back()
On Error Resume Next
ActiveSheet.Previous.Select
End Sub

Private Sub Move_Next()
On Error Resume Next
ActiveSheet.Next.Select
End Su

--
huntermc
-----------------------------------------------------------------------
huntermcg's Profile: http://www.excelforum.com/member.php...fo&userid=1939
View this thread: http://www.excelforum.com/showthread.php?threadid=47458

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Navigation Ridhi Excel Worksheet Functions 1 June 3rd 08 06:00 PM
navigation Pam M Excel Discussion (Misc queries) 3 November 7th 07 09:47 PM
Navigation slavenp Excel Discussion (Misc queries) 3 August 15th 07 07:03 PM
Navigation dgragg Excel Worksheet Functions 1 April 5th 06 08:10 AM
Navigation help please Walt Campbell New Users to Excel 3 May 30th 05 08:52 PM


All times are GMT +1. The time now is 08:36 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"