Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 238
Default Toolbar to launch Macros

I have created a customized Toolbar to launch Macros , a procedure by
Dave Peterson. Adds a nice professional touch.
http://www.contextures.com/xlToolbar02.html#Setup
I need to limit the macro only to a few sheets. Can I add code to
"Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)"
that will enable or disable my toolbar macro?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 206
Default Toolbar to launch Macros

Try the workbook module instead

Private Sub Workbook_SheetActivate(ByVal Sh As Object)
If ActiveSheet.Name = "Sheet1" Or ActiveSheet.Name = "Sheet2" Then
MsgBox "Your toolBar Macro Here" 'change to Call CreateMenubar
End If
End Sub

Private Sub Workbook_SheetDeactivate(ByVal Sh As Object)
MsgBox "Your remove toolbar Macro Here" ' change to Call RemoveMenubar
End Sub
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 364
Default Toolbar to launch Macros

I'll just use something like this in the sheet code mdules:

Private Sub Worksheet_Deactivate()
RemoveToolbar ' this is contains code that removes the toolbar
End Sub

and

Private Sub Worksheet_Deactivate()
CreateToolbar ' this module contains code to create the toolbar
End Sub
--


Gary K



"Fan924" wrote in message
...
I have created a customized Toolbar to launch Macros , a procedure by
Dave Peterson. Adds a nice professional touch.
http://www.contextures.com/xlToolbar02.html#Setup
I need to limit the macro only to a few sheets. Can I add code to
"Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)"
that will enable or disable my toolbar macro?


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 238
Default Toolbar to launch Macros

Thanks guys. I guess i didn't study it long enough. The downloaded
from the link above contained the following.
Sub RemoveMenubar()
Sub CreateMenubar()
Now it turns on and off when I select a sheet. Looking good.

The toolbar pops up in the middle of the page and not with the other
menus at the top.
Any way to fix that?
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 238
Default Toolbar to launch Macros

Got it
..Position = msoBarFloat
change to
..Position = msoBarTop
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
Can you launch Macros from a customized Toolbar? Fan924 Excel Programming 4 December 7th 08 06:16 AM
toolbar macros Ned Kelly Excel Discussion (Misc queries) 0 December 22nd 05 03:52 PM
Macro launch - Button vs Manual launch , has different results. Wayne Excel Programming 4 February 23rd 05 11:33 AM
Toolbar macros TMAC Excel Programming 4 September 17th 04 09:00 PM
Macros - call or launch from fromula Paul Excel Programming 2 September 3rd 03 08:09 PM


All times are GMT +1. The time now is 07:32 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"