Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Mike,
As a starting point, try: '============= Public Sub TesterA001() Dim Ctrl As Office.CommandBarControl For Each Ctrl In Application.CommandBars.FindControls(ID:=4) MsgBox "Commandbar: " & Ctrl.Parent.Name _ & " position = " & Ctrl.Index Next Ctrl End Sub '<<============= --- Regards, Norman "mikeburg" wrote in message ... What would be the simplest VBA code to locate the command bar number that the printer command button is on & put the number into a variable. I am trying to add two command buttons immediately after the printer command button but it's on different command bars from computer to computer. For example, it may be on command bar #3 on one computer but on #4 of another computer. Thanks. I dream of a day when I would be half as good at VBA as you guys. Thanks, mikeburg -- mikeburg ------------------------------------------------------------------------ mikeburg's Profile: http://www.excelforum.com/member.php...o&userid=24581 View this thread: http://www.excelforum.com/showthread...hreadid=507006 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
command button code | Excel Discussion (Misc queries) | |||
VBA code behind command button | Excel Worksheet Functions | |||
Using code from custom menu bar to a Command button | Excel Programming | |||
Command Button VBA code | Excel Discussion (Misc queries) | |||
Create Command Button from Code | Excel Programming |