Home |
Search |
Today's Posts |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Great - thanks a lot guys - looks good
Cheers Matt "Jim Cone" wrote in message ... Matt, Looks like there is an easier way, using msoBarRowLast... '-------------------------- Sub TestBarModified() Dim MyCommandBar As CommandBar Set MyCommandBar = CommandBars.Add(Name:="MyBar", _ Position:=msoBarTop, Temporary:=True) MyCommandBar.RowIndex = msoBarRowLast MyCommandBar.Visible = True Set MyCommandBar = Nothing End Sub '-------------------------- Regards, Jim Cone "Jim Cone" wrote in message ... Matt, You need to provide the "RowIndex"... MyCommandBar.RowIndex = Application.CommandBars("Formatting").RowIndex + 1 If the Formatting toolbar is visible, the above code places MyCommandBar just below the formatting toolbar. No, you cannot determine the rowindex by just counting the visible toolbars. Also, you still need msoBarTop. OR, go thru the CommandBar collection and find the largest rowindex... Sub TestBar() Dim MyCommandBar As CommandBar Dim lngBarIndex As Long For Each MyCommandBar In Application.CommandBars If MyCommandBar.Visible Then lngBarIndex = _ WorksheetFunction.Max(lngBarIndex, MyCommandBar.RowIndex) Next Set MyCommandBar = CommandBars.Add(Name:="MyBar", _ Position:=msoBarTop, Temporary:=True) MyCommandBar.RowIndex = lngBarIndex + 1 MyCommandBar.Visible = True Set MyCommandBar = Nothing End Sub Regards, Jim Cone San Francisco, USA |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
One command in one cell initiating another command in another cel. | Excel Worksheet Functions | |||
command code ( GOTO command) in formula | New Users to Excel | |||
command button position | Excel Discussion (Misc queries) | |||
Pivot Table Error Message - "Command Text not set for command obje | Excel Discussion (Misc queries) | |||
Command Button Position | Excel Discussion (Misc queries) |