+ Reply to Thread
Results 1 to 3 of 3

Variable Toolbar

  1. #1
    Registered User
    Join Date
    09-23-2004
    Posts
    65

    Variable Toolbar

    I want to make a variable toolbar. Sometimes there are 4 charts possible, connected to 4 buttons. Sometimes 2 or 3.

    Here my code

    For iCH = 1 To numCHARTS
    onAct = "MAKEchart" & iCH
    '??????? how to do this ??????
    '??Set MyButtonCHART & iCH ?? = .Controls.Add(Type:=msoControlButton)
    With MyButtonvarCHART & iCH ...???
    .Caption = "chart" & iCH
    .Style = msoButtonCaption
    .BeginGroup = True
    '.OnAction = onAct
    End With
    Next iCH

    Some help is always welcome. Thx

    Zurn

  2. #2
    Bob Phillips
    Guest

    Re: Variable Toolbar

    Application.CommandBars.Add Name:="MyCharts", temporary:=True
    With Application.CommandBars("MyCharts")
    For iCH = 1 To numCHARTS
    With .Controls.Add(Type:=msoControlButton)
    .Caption = "chart" & iCH
    .Style = msoButtonCaption
    .BeginGroup = True
    .OnAction = "MAKEchart" & iCH
    End With
    Next iCH
    End With


    --
    HTH

    Bob Phillips

    (remove nothere from email address if mailing direct)

    "Zurn" <Zurn.25c1so_1143470402.3773@excelforum-nospam.com> wrote in message
    news:Zurn.25c1so_1143470402.3773@excelforum-nospam.com...
    >
    > I want to make a variable toolbar. Sometimes there are 4 charts
    > possible, connected to 4 buttons. Sometimes 2 or 3.
    >
    > Here my code
    >
    > For iCH = 1 To numCHARTS
    > onAct = "MAKEchart" & iCH
    > '??????? how to do this ??????
    > '??Set MyButtonCHART & iCH ?? =
    > Controls.Add(Type:=msoControlButton)
    > With MyButtonvarCHART & iCH ...???
    > Caption = "chart" & iCH
    > Style = msoButtonCaption
    > BeginGroup = True
    > '.OnAction = onAct
    > End With
    > Next iCH
    >
    > Some help is always welcome. Thx
    >
    > Zurn
    >
    >
    > --
    > Zurn
    > ------------------------------------------------------------------------
    > Zurn's Profile:

    http://www.excelforum.com/member.php...o&userid=14645
    > View this thread: http://www.excelforum.com/showthread...hreadid=526740
    >




  3. #3
    Registered User
    Join Date
    09-23-2004
    Posts
    65
    Thx Bob,

    this saved me a lot of typing work...


    Zurn

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1