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: 11
Default How do I add a vertical spacer bar in toolbar

I have some VBA code that creates a new toolbar when I open the
spreadsheet. The toolbar has two buttons on it which are labelled with
words rather than an icon. The two buttons run other macros. I would
like to include some additional code that will place a vertical spacer
bar between the two buttons so that they look more separated on the screen.

I have tried recording a macro whilst doing the process manually but the
macro had no code in it when I finished.

Can anybody tell me what the code is that I should use? I am using XL97
on Win NT 4.

The code that creates the toolbar is as follows:


Sub MakeToolBar()

Dim Ctl As CommandBarControl

On Error Resume Next
Application.CommandBars("Sorting projects").Delete
On Error GoTo 0

'Create the toolbar
Application.CommandBars.Add ("Sorting projects")

'Add the first button
Set Ctl = Application.CommandBars("Sorting projects").Controls.Add
With Ctl
.Style = msoButtonCaption
.Width = 112
.Caption = "Subtotal by Funding Source"
.TooltipText = "Sort and subtotal by Funding Source"
.OnAction = "Subtotal_By_Funder"
End With

'Add the second button
Set Ctl = Application.CommandBars("Sorting projects").Controls.Add
With Ctl
.Style = msoButtonCaption
.Width = 112
.Caption = "Subtotal by Work Stage"
.TooltipText = "Sort and subtotal by Work Stage"
.OnAction = "Subtotal_By_Stage"
End With

'Make toolbar visible
Application.CommandBars("Sorting projects").Visible = True

End Sub


 
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
How do I make a vertical report export into a vertical report? April Excel Discussion (Misc queries) 3 January 18th 10 11:13 PM
Vertical line isn't vertical! [email protected] Charts and Charting in Excel 2 September 13th 06 01:54 PM
Vertical line isn't vertical! Ray Excel Discussion (Misc queries) 0 September 12th 06 02:33 PM
Vertical line in a histogram (vertical bar chart) AdamCPTD Excel Discussion (Misc queries) 0 July 13th 06 09:43 PM
How do i insert of spacer rows between rows in large spreadsheets laurel Excel Discussion (Misc queries) 0 April 24th 06 01:38 PM


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