Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Select standard toolbar button option
On the worksheet I can pull-down:
View Toolbars Customize I can then right-click any of the standard toolbar buttons and select: Image and Text How can I do this with VBA? -- Gary''s Student gsnu200710 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Select standard toolbar button option
Sure. Turn on the macro recorder while you do it manually or sample code.
.Style = msoButtonIconAndCaption -- Regards, Tom Ogilvy "Gary''s Student" wrote: On the worksheet I can pull-down: View Toolbars Customize I can then right-click any of the standard toolbar buttons and select: Image and Text How can I do this with VBA? -- Gary''s Student gsnu200710 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Select standard toolbar button option
Thank you
-- Gary''s Student gsnu200710 "Tom Ogilvy" wrote: Sure. Turn on the macro recorder while you do it manually or sample code. .Style = msoButtonIconAndCaption -- Regards, Tom Ogilvy "Gary''s Student" wrote: On the worksheet I can pull-down: View Toolbars Customize I can then right-click any of the standard toolbar buttons and select: Image and Text How can I do this with VBA? -- Gary''s Student gsnu200710 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Select standard toolbar button option
Code like this...
Sub test() Dim cbr As CommandBar Dim ctl As CommandBarControl Set cbr = Application.CommandBars("Standard") Set ctl = cbr.Controls("Open") ctl.Style = msoButtonIconAndCaption End Sub or did you want the customize dialog -- HTH... Jim Thomlinson "Gary''s Student" wrote: On the worksheet I can pull-down: View Toolbars Customize I can then right-click any of the standard toolbar buttons and select: Image and Text How can I do this with VBA? -- Gary''s Student gsnu200710 |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Select standard toolbar button option
Thank you.
I'll use it in this form. Don't need a dialog since I'll be doing it in loops. Thanks again. -- Gary's Student gsnu200710 "Jim Thomlinson" wrote: Code like this... Sub test() Dim cbr As CommandBar Dim ctl As CommandBarControl Set cbr = Application.CommandBars("Standard") Set ctl = cbr.Controls("Open") ctl.Style = msoButtonIconAndCaption End Sub or did you want the customize dialog -- HTH... Jim Thomlinson "Gary''s Student" wrote: On the worksheet I can pull-down: View Toolbars Customize I can then right-click any of the standard toolbar buttons and select: Image and Text How can I do this with VBA? -- Gary''s Student gsnu200710 |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Select standard toolbar button option
Not that you need the loop code but...
Sub test() Dim cbr As CommandBar Dim ctl As CommandBarControl Set cbr = Application.CommandBars("Standard") For Each ctl In cbr.Controls ctl.Style = msoButtonIconAndCaption Next ctl End Sub -- HTH... Jim Thomlinson "Gary''s Student" wrote: Thank you. I'll use it in this form. Don't need a dialog since I'll be doing it in loops. Thanks again. -- Gary's Student gsnu200710 "Jim Thomlinson" wrote: Code like this... Sub test() Dim cbr As CommandBar Dim ctl As CommandBarControl Set cbr = Application.CommandBars("Standard") Set ctl = cbr.Controls("Open") ctl.Style = msoButtonIconAndCaption End Sub or did you want the customize dialog -- HTH... Jim Thomlinson "Gary''s Student" wrote: On the worksheet I can pull-down: View Toolbars Customize I can then right-click any of the standard toolbar buttons and select: Image and Text How can I do this with VBA? -- Gary''s Student gsnu200710 |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
Select standard toolbar button option
Jim/Student,
I doubt this code will be run, but just a heads up, the Standard commandbar has 3 types of controls: CommandBarPopup &Paste CommandBarButton &Format Painter CommandBarComboBox &Undo as examples. The CommandBarCombobox has a style property, but it doesn't support msobuttonIconandCaption. The CommandBarPopup doesn't have a style property. So this code will produce an error after changing some of the buttons. -- Regards, Tom Ogilvy "Jim Thomlinson" wrote in message ... Not that you need the loop code but... Sub test() Dim cbr As CommandBar Dim ctl As CommandBarControl Set cbr = Application.CommandBars("Standard") For Each ctl In cbr.Controls ctl.Style = msoButtonIconAndCaption Next ctl End Sub -- HTH... Jim Thomlinson "Gary''s Student" wrote: Thank you. I'll use it in this form. Don't need a dialog since I'll be doing it in loops. Thanks again. -- Gary's Student gsnu200710 "Jim Thomlinson" wrote: Code like this... Sub test() Dim cbr As CommandBar Dim ctl As CommandBarControl Set cbr = Application.CommandBars("Standard") Set ctl = cbr.Controls("Open") ctl.Style = msoButtonIconAndCaption End Sub or did you want the customize dialog -- HTH... Jim Thomlinson "Gary''s Student" wrote: On the worksheet I can pull-down: View Toolbars Customize I can then right-click any of the standard toolbar buttons and select: Image and Text How can I do this with VBA? -- Gary''s Student gsnu200710 |
#8
Posted to microsoft.public.excel.programming
|
|||
|
|||
Select standard toolbar button option
Thanks Tom... One way...
Sub test() Dim cbr As CommandBar Dim ctl As CommandBarControl Set cbr = Application.CommandBars("Standard") For Each ctl In cbr.Controls With ctl If .Type = msoControlButton Then .Style = msoButtonIconAndCaption End With Next ctl End Sub Or you could just use on error resume next with the previous code... -- HTH... Jim Thomlinson "Tom Ogilvy" wrote: Jim/Student, I doubt this code will be run, but just a heads up, the Standard commandbar has 3 types of controls: CommandBarPopup &Paste CommandBarButton &Format Painter CommandBarComboBox &Undo as examples. The CommandBarCombobox has a style property, but it doesn't support msobuttonIconandCaption. The CommandBarPopup doesn't have a style property. So this code will produce an error after changing some of the buttons. -- Regards, Tom Ogilvy "Jim Thomlinson" wrote in message ... Not that you need the loop code but... Sub test() Dim cbr As CommandBar Dim ctl As CommandBarControl Set cbr = Application.CommandBars("Standard") For Each ctl In cbr.Controls ctl.Style = msoButtonIconAndCaption Next ctl End Sub -- HTH... Jim Thomlinson "Gary''s Student" wrote: Thank you. I'll use it in this form. Don't need a dialog since I'll be doing it in loops. Thanks again. -- Gary's Student gsnu200710 "Jim Thomlinson" wrote: Code like this... Sub test() Dim cbr As CommandBar Dim ctl As CommandBarControl Set cbr = Application.CommandBars("Standard") Set ctl = cbr.Controls("Open") ctl.Style = msoButtonIconAndCaption End Sub or did you want the customize dialog -- HTH... Jim Thomlinson "Gary''s Student" wrote: On the worksheet I can pull-down: View Toolbars Customize I can then right-click any of the standard toolbar buttons and select: Image and Text How can I do this with VBA? -- Gary''s Student gsnu200710 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I replicate a macro for each button on standard toolbar? | Excel Discussion (Misc queries) | |||
How do I duplicate a macro for a button on the Standard Toolbar? | Excel Discussion (Misc queries) | |||
How to get Research button on my standard toolbar? | Excel Discussion (Misc queries) | |||
Fax Button on Standard Toolbar | Excel Discussion (Misc queries) | |||
Adding Macro Button on Standard Toolbar | Excel Programming |