+ Reply to Thread
Results 1 to 6 of 6

Creating VBA Button to Do Two Operations Simultaneously

  1. #1
    Registered User
    Join Date
    12-18-2018
    Location
    Phuket, Thailand
    MS-Off Ver
    Windows 11 - MS Office 365
    Posts
    88

    Post Creating VBA Button to Do Two Operations Simultaneously

    Hi /all,

    I would like a VBA code that completes two operations at the same time. I am an extreme novice and pretty much need to the whole thing spelled out for me.

    I would like a button on Sheet1 to do the following two commands simultaneously:
    - Hide Sheet2
    - Hide ColumnB in Sheet3

    I will also have another button that does the opposite of the above (I am pretty such I can figure that out once I have the above code).

    Thank you in advance!

    DJC

  2. #2
    Forum Expert PaulM100's Avatar
    Join Date
    10-09-2017
    Location
    UK
    MS-Off Ver
    Office 365
    Posts
    2,108

    Re: Creating VBA Button to Do Two Operations Simultaneously

    To Hide:
    Please Login or Register  to view this content.
    To Unhide:
    Please Login or Register  to view this content.
    Click the * to say thanks.

  3. #3
    Forum Contributor
    Join Date
    06-07-2016
    Location
    Manila
    MS-Off Ver
    365
    Posts
    292

    Re: Creating VBA Button to Do Two Operations Simultaneously

    See attached.
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    12-18-2018
    Location
    Phuket, Thailand
    MS-Off Ver
    Windows 11 - MS Office 365
    Posts
    88

    Re: Creating VBA Button to Do Two Operations Simultaneously

    Hi Paul,

    Thanks for the help! I'm really sorry but I've just realised it's a little more complicated than this, still wondering if you can help!

    So, I want "Private Sub CommandButton2_Click()" to do THREE things (sorry, not two):
    1 - Close Sheet2
    2 - Close columns C, K, S, AA on Sheet3
    3 - Hide columns C, J, R Z on Sheet4

    Sheet 2 Name - Thai Menu
    Sheet 3 Name - Menu-MASTER
    Sheet 4 Name - Options-MASTER

    I have used a command button for this process, please advise me if you think their is a better solution (perhaps an ON/OFF button that shows/hides the above).

    Thanks again,

    Danny


    (Thai Menu)

  5. #5
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,286

    Re: Creating VBA Button to Do Two Operations Simultaneously

    Using the same button
    Please Login or Register  to view this content.

  6. #6
    Valued Forum Contributor dotchiejack's Avatar
    Join Date
    05-21-2015
    Location
    Antwerp,Belgium
    MS-Off Ver
    2016
    Posts
    507

    Re: Creating VBA Button to Do Two Operations Simultaneously

    I used a togglebutton
    Please Login or Register  to view this content.
    See attached
    Attached Files Attached Files
    Click the * Add Reputation below to say thanks.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Button to calculate multiple math operations in a userform, at once
    By Alex Piotto in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 03-26-2018, 05:56 AM
  2. Creating a Macros Button
    By triumphlugo in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-19-2015, 08:07 AM
  3. [SOLVED] Creating a macro button with VBA
    By amotto11 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-15-2012, 12:50 PM
  4. VBA - Help creating a Macro for a button
    By JukeBoxHero in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 08-01-2012, 07:47 AM
  5. VBA - Help creating a Macro for a button
    By JukeBoxHero in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-11-2012, 07:53 AM
  6. Creating Command button
    By april73 in forum Excel General
    Replies: 1
    Last Post: 07-28-2011, 02:15 AM
  7. Creating a Macro Button
    By Newton1234 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-12-2008, 11:46 AM

Tags for this Thread

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