Abbasi
06-02-2008, 03:26 AM
Hello everybody
I am in need of adding a Menu Option for a Specific Worksheet, programmatically.
I will aprreciate any programmatic solution.
Regards,
Colin Legg
06-02-2008, 03:30 AM
Hello Abbasi,
I assume you mean for a specific workbook?
Lesson 11 in the Excel FAQ should get you started.
http://www.xtremevbtalk.com/showpost.php?postid=335706&postcount=12
HTH
Colin
Abbasi
06-02-2008, 10:51 AM
Hi Colin
Thank you very much for rescuing another time. The help is great.
By the way, is it possible to limit the custom menus to a single worksheet instead of the whole workbook - just food for thoughts :-)
Wish you the best time.
Best regards,
Colin Legg
06-02-2008, 12:13 PM
Hi Colin
Thank you very much for rescuing another time. The help is great.
By the way, is it possible to limit the custom menus to a single worksheet instead of the whole workbook - just food for thoughts :-)
Wish you the best time.
Best regards,
You're very welcome, Abbasi. :)
What you'll have to think about is that commandbars belong to the application and not a workbook or a worksheet.
If you want to enable your menu only for a certain worksheet then you'll have to monitor for the user to activate that worksheet and enable the custom menu when that event happens. Conversely, when the user deactives the worksheet you'll have to disable your custom menu.
Colin
Abbasi
06-02-2008, 10:18 PM
You are right. It means, if we place the Custom MenuBar code inside the Worksheet_Activate () and the Worksheet_Deactivate () events, we can limit the feature to a particular worksheet.
Thanks for your persistent guidance and regards.