Page 2 of 2 FirstFirst 12
Results 11 to 12 of 12

Thread: Running multiple macros with one command button on userform
Thanks Thanks: 0 Likes Likes: 0

  1. #11
    Board Regular My Aswer Is This's Avatar
    Join Date
    Jul 2014
    Posts
    15,820
    Post Thanks / Like
    Mentioned
    28 Post(s)
    Tagged
    13 Thread(s)

    Default Re: Running multiple macros with one command button on userform

    Assuming all your scripts work OK when the buttons are pressed separately then I'm not sure what the problem might be.

    You are using select a lot.

    Try using a script like this:
    You will see I did not use select and activate.

    Code:
    Private Sub CommandButton11_Click()
    'Modified  9/22/2019  12:47:36 AM  EDT
        If Range("os56") = 0 Then
            Range("AA81:AA83").RowHeight = 0.000001
            Range("os56") = 4
        Else
            Range("AA81:AA82").RowHeight = 12.75
            Range("AA83:AA83").RowHeight = 13.5
            Range("os56") = 0
    End If
    End Sub
    Last edited by My Aswer Is This; Sep 22nd, 2019 at 12:55 AM.
    Be sure and always test this script on sample data the first time you use this as to avoid any problems with your data. Always trying to learn more and help others where I can. I'm using Excel 2013.
    Patience please Iím not perfect yet. "Memories are forever"

  2. #12
    MrExcel MVP
    Moderator
    Fluff's Avatar
    Join Date
    Jun 2014
    Location
    Chippenham
    Posts
    28,210
    Post Thanks / Like
    Mentioned
    471 Post(s)
    Tagged
    47 Thread(s)

    Default Re: Running multiple macros with one command button on userform

    You haven't removed the word Private from the procedure name. This
    Code:
    Private Sub CommandButton11_Click()
    should be
    Code:
    Sub CommandButton11_Click()
    - Posting Data try one of these tools
    - Posting guidelines, forum rules and terms of use
    - Read the FAQs

    Running Office 365 on Win 10

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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