+ Reply to Thread
Results 1 to 4 of 4

How to make buttons to select certain cells and then click on a button to clear data?

  1. #1
    Registered User
    Join Date
    05-30-2012
    Location
    Hong Kong
    MS-Off Ver
    Excel 2003
    Posts
    95

    How to make buttons to select certain cells and then click on a button to clear data?

    Hi All,

    I've created an excel as attached.

    1. to check the checkbox on cell B3 then C3:E3 will be selected, uncheck it to de-select C3:E3.
    2. to check the checkbox on cell B4 then C4:E4 will be selected, uncheck it to de-select C4:E4.
    3. to check the checkbox on cell B6 then checkboxes B3 and B4 will be checked automatically, thus C3:E3 and C4:E4 will be selected, uncheck it then all checkboxes will be unchcked.
    4. to click "Clear" button on B8, then clear all values of the selected cells; no effect if checkboxe B3 or B4 is not not selected.

    But how to do this? Thanks!
    Last edited by ohlalayeah; 06-05-2012 at 04:35 AM.

  2. #2
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: How to make buttons to select certain cells and then click on a button to clear data?

    Hi,

    Ensure, the "Select All" checkbox is assigned a macro that executes all other macros (which select row-specific cells) i.e.
    Application.Run _
    "'Development_INDIRECT(VLOOKUP(SUBSTITUTE()))_Clearbutton_Swing Ticket-20120604-test.xls'!Macro1"
    Application.Run _
    "'Development_INDIRECT(VLOOKUP(SUBSTITUTE()))_Clearbutton_Swing Ticket-20120604-test.xls'!Macro2"

    ..and so on

    The Clear button should be assigned a separate macro i.e.
    Selection.ClearContents

    Cheers

  3. #3
    Registered User
    Join Date
    05-30-2012
    Location
    Hong Kong
    MS-Off Ver
    Excel 2003
    Posts
    95

    Re: How to make buttons to select certain cells and then click on a button to clear data?

    Thanks Ace_XL,

    The scripts look simple but do you mind putting them into my excel file and attach here? Sorry that I am stupid. Thanks!

  4. #4
    Registered User
    Join Date
    05-30-2012
    Location
    Hong Kong
    MS-Off Ver
    Excel 2003
    Posts
    95

    Re: How to make buttons to select certain cells and then click on a button to clear data?

    I have modified my post hope it would be easier. Thanks!

+ 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