0

My code creates 2 buttons on a custom Commandbar. It's working fine, but the 2 buttons are side by side, and I want them vertically stacked. How can I fix this ?

Sub Crea_Menu()
    With Application.CommandBars.Add(Name:="GL", Temporary:=True)
        .Visible = True
        .Width = .Height / 2    'tried this but has no effect !
        With .Controls.Add(Type:=msoControlButton, Temporary:=True)
            .OnAction = "GenerateRpt"
            .Caption = "GL report"
            .Style = msoButtonCaption
        End With
        With .Controls.Add(Type:=msoControlButton, Temporary:=True)
            .OnAction = "Version"
            .Caption = "Version " & Format(Sheet2.Range("A2").Value2, "0.00")
            .Style = msoButtonCaption
        End With
    End With
End Sub
iDevlop
  • 24,841
  • 11
  • 90
  • 149
  • What about `.Position = msoBarFloating` in conjunction with the Width property? – SJR Jan 11 '19 at 15:34
  • @SJR I don't want a floating Commandbar. I want it where it is, just have controls arranged vertically instead of horizontally. – iDevlop Jan 11 '19 at 15:49

0 Answers0