Regards,
--
Beto
Reply: Erase between the dot (inclusive) and the @.
Responder: Borra la frase obvia y el punto previo.
My custom commandbar in this example has a Name of "Rob".
Sub testit()
Dim cbrMy As CommandBar
Dim cbr As CommandBar, lngMaxRowIndex As Long, lngMaxLeft As Long
Set cbrMy = CommandBars("Rob")
For Each cbr In CommandBars
If cbr.Visible And cbr.Position = msoBarTop And Not (cbr.Index =
cbrMy.Index) Then
If cbr.RowIndex > lngMaxRowIndex Then
lngMaxRowIndex = cbr.RowIndex
lngMaxLeft = cbr.Left + cbr.Width
ElseIf cbr.RowIndex = lngMaxRowIndex And cbr.Left + cbr.Width >
lngMaxLeft Then
lngMaxLeft = cbr.Left + cbr.Width
End If
End If
Next
cbrMy.Position = msoBarTop
cbrMy.RowIndex = lngMaxRowIndex
cbrMy.Left = lngMaxLeft
End Sub
Rob
"Beto" <beto_z_o....@hotmail.com> wrote in message
news:bu41od$cha8q$1...@ID-95421.news.uni-berlin.de...
> Beto,
>
> My custom commandbar in this example has a Name of "Rob".
>
> Sub testit()
> Dim cbrMy As CommandBar
> Dim cbr As CommandBar, lngMaxRowIndex As Long, lngMaxLeft As Long
>
> Set cbrMy = CommandBars("Rob")
>
> For Each cbr In CommandBars
> If cbr.Visible And cbr.Position = msoBarTop And Not (cbr.Index =
> cbrMy.Index) Then
> If cbr.RowIndex > lngMaxRowIndex Then
> lngMaxRowIndex = cbr.RowIndex
> lngMaxLeft = cbr.Left + cbr.Width
> ElseIf cbr.RowIndex = lngMaxRowIndex And cbr.Left + cbr.Width >
> lngMaxLeft Then
> lngMaxLeft = cbr.Left + cbr.Width
> End If
> End If
> Next
>
> cbrMy.Position = msoBarTop
> cbrMy.RowIndex = lngMaxRowIndex
> cbrMy.Left = lngMaxLeft
> End Sub
Great piece of code. This should get me started to my final needs.
Thanks!
--
Beto
Reply: Erase between the dot (inclusive) and the @.
Responder: Borra la frase obvia y el punto previo.
>