Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Adding a divider to an add-in using vba in excel 2007

I have done some research and thought that I had this figured out, but it is
not giving me the result that I am looking for. I am trying to add a divider
to a drop down list between different macros. I thought this was done by the
BeginGroup property, but it is not adding the divider. I have posted a
section of my code below. Can anyone tell me if I am going about this wrong?
Any help would be great. Thanks, Jason



Set cmdBar = Application.CommandBars("Worksheet Menu Bar")
Set cmdBarMenu = cmdBar.Controls.Add(Type:=msoControlPopup,
temporary:=True)
With cmdBarMenu
.Caption = "Tools"
.Tag = "JJT"
End With

Set cmdBarMenuItem = cmdBarMenu.Controls.Add(Type:=msoControlButton)
With cmdBarMenuItem
.Caption = "Merge"
.OnAction = "MergeCells"
.Tag = "JJT"
.FaceId = 798
End With

cmdBarMenu.BeginGroup = True

Set cmdBarMenuItem = cmdBarMenu.Controls.Add
With cmdBarMenuItem
.Caption = "Unmerge"
.OnAction = "UnmergeCells"
.Tag = "JJT"
.FaceId = 800
End With

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,549
Default Adding a divider to an add-in using vba in excel 2007

See the two <<< notations below...
--
Jim Cone
Portland, Oregon USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)




"test_52"
wrote in message
I have done some research and thought that I had this figured out, but it is
not giving me the result that I am looking for. I am trying to add a divider
to a drop down list between different macros. I thought this was done by the
BeginGroup property, but it is not adding the divider. I have posted a
section of my code below. Can anyone tell me if I am going about this wrong?
Any help would be great. Thanks, Jason

Set cmdBar = Application.CommandBars("Worksheet Menu Bar")
Set cmdBarMenu = cmdBar.Controls.Add(Type:=msoControlPopup,
temporary:=True)
With cmdBarMenu
.Caption = "Tools"
.Tag = "JJT"
End With
Set cmdBarMenuItem = cmdBarMenu.Controls.Add(Type:=msoControlButton)
With cmdBarMenuItem
.Caption = "Merge"
.OnAction = "MergeCells"
.Tag = "JJT"
.FaceId = 798
End With

'cmdBarMenu.BeginGroup = True '<<<< Not this

Set cmdBarMenuItem = cmdBarMenu.Controls.Add
With cmdBarMenuItem
.Caption = "Unmerge"
.OnAction = "UnmergeCells"
.Tag = "JJT"
.FaceId = 800
.BeginGroup = True '<<<< Do this instead
End With

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Adding a divider to an add-in using vba in excel 2007

Thanks a bunch! Figures it was something easy!

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
Multiple text-number in cell divider formula? ekonomija Excel Worksheet Functions 1 May 18th 10 10:33 PM
Word destrots the comma as decimal divider in Excel Tvermoes Excel Discussion (Misc queries) 1 August 26th 05 03:01 PM
Change Dots into Commas as Decimal Divider xenia Excel Discussion (Misc queries) 2 August 8th 05 09:48 AM
VBA to add group divider to custom menu ken smith[_2_] Excel Programming 2 January 19th 04 09:46 AM
formula for avarage with a variable divider marius Excel Programming 2 January 9th 04 06:29 PM


All times are GMT +1. The time now is 05:58 PM.

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"