Results 1 to 4 of 4
  1. #1
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    cicling all commandbutton (2000 sp 1)

    how to cicling all commandbutton in userform, and for each commandbutton found goto my macro?

  2. #2
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: cicling all commandbutton (2000 sp 1)

    Something like this:
    <pre> Dim ctl As Object
    For Each ctl In Me.Controls
    If TypeOf ctl Is MSForms.CommandButton Then
    Call myMacro
    End If
    Next ctl
    </pre>

    Regards,
    Rory

    Microsoft MVP - Excel

  3. #3
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: cicling all commandbutton (2000 sp 1)

    tks Rory your code work...nice!

  4. #4
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: cicling all commandbutton (2000 sp 1)

    Glad to help.
    Regards,
    Rory

    Microsoft MVP - Excel

Posting Permissions

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