Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default I N D E X menu via Tabs Popup

Hi,

I am using this code from Dave Haley’s free excel
newsletter (please refer to www.ozgrid.com )

Quote:
================================================== =
“The other method that can be used, which is probably a
lot more user-friendly, is to manipulate the pop-up menu
displayed when you right click on any Cell in any
Worksheet. To this we can add our own menu item which
when clicked will show the standard Workbook Tabs Command
Bar. If you are not familiar with this Command Bar, you
can see it by right-clicking on your Sheet Scroll Tab
arrows on the bottom left of any Worksheet.

_____

Private Sub Workbook_SheetBeforeRightClick(ByVal Sh As
Object, ByVal Target As Range, Cancel As Boolean)
Dim cCont As CommandBarButton
On Error Resume Next
Application.CommandBars("Cell").Controls("Sheet
Index").Delete
On Error GoTo 0
Set cCont = Application.CommandBars
("Cell").Controls.Add _
(Type:=msoControlButton,
Temporary:=True)
cCont.Caption = "Sheet Index"
cCont.OnAction = "IndexCode"
End Sub

_____

To insert the code as shown above:

1. Open the your Workbook and then right click on the
Excel icon immediately to the left of the File Item on the
Worksheet Menu Bar and select View Code. Now enter the
code exactly as shown above

2. Go to InsertModule to insert a Standard Module and
enter in the following code. This macro (IndexCode) is
called via the code we entered in Step 1 whenever a user
right clicks on any Worksheet.

Sub IndexCode()
Application.CommandBars("Workbook Tabs").ShowPopup
End Sub

===============================================
End of quotation.

When I shut the workbook where I have this code,
the “sheet index” control appears in every other workbook
upon rightclicking of a cell (Unless I close an
application completely). When clicked it shows the right
indexing for a given wkbook; however it opens the original
workbook (the one with the code) on the background.
Moreover, even though the original workbook has code, it
doesn’t give me the usual macro warning!

Do you know why this is happening and what is the
workaround?

Thanks,
Greg

Reply
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
Popup Menu / Shortcut Menu Dale Fye Excel Discussion (Misc queries) 2 October 12th 07 12:57 AM
Worksheet tabs as menu? Kevryl Excel Discussion (Misc queries) 4 July 25th 06 02:18 PM
Non-functional Popup Menu Boxes Jim_M Charts and Charting in Excel 0 January 20th 05 04:27 PM
add combo box at popup menu GUS Excel Programming 1 September 25th 03 07:27 AM
Modifying the right-click popup menu of a shape Don Lopez Excel Programming 2 July 23rd 03 10:03 PM


All times are GMT +1. The time now is 07:40 AM.

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

About Us

"It's about Microsoft Excel"