+ Reply to Thread
Results 1 to 6 of 6

Use excel form Checkbox and tweak macro to suit.

  1. #1
    Registered User
    Join Date
    08-11-2009
    Location
    Lancashire England
    MS-Off Ver
    Excel 2007
    Posts
    34

    Use excel form Checkbox and tweak macro to suit.

    Hi

    I have a set of sheets that I indicate items to be processed by a macro by inputting 'Y' into the cell.

    I would like to use the form 'Checkbox' which will be quicker/easier for me to select/deselect as required. However I need help to edit my macro to suit.

    The lines in my macro which see the 'Y' is;

    Please Login or Register  to view this content.
    Please see my attached sample.

    Thanks
    Attached Files Attached Files

  2. #2
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Use excel form Checkbox and tweak macro to suit.

    The syntax for Forms checkboxes is

    Please Login or Register  to view this content.
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  3. #3
    Registered User
    Join Date
    08-11-2009
    Location
    Lancashire England
    MS-Off Ver
    Excel 2007
    Posts
    34

    Re: Use excel form Checkbox and tweak macro to suit.

    Hi, thanks. Sorry for my ignorance but do I just replace this line with your code?

    If UCase(sh1.Cells(i, 35)) = "Y" Then

  4. #4
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Use excel form Checkbox and tweak macro to suit.

    What do you want the macro to do if the checkbox is checked? What when the checkbox isn't?

  5. #5
    Registered User
    Join Date
    08-11-2009
    Location
    Lancashire England
    MS-Off Ver
    Excel 2007
    Posts
    34

    Re: Use excel form Checkbox and tweak macro to suit.

    Hi Sorry for delay in replying after you took the trouble to respond...

    Ok, I have a macro which looks in a table and places the data into a format for printing selected records into a A4 template. Currently I input "Y" into a cell at the front of the table so the macro includes that row of data in the results. If the checkbox is checked I want the macro to run on that row of data.

    If the checkbox is not checked, I want the macro to ignore that row (i.e. at present when cell is left blank). The macro runs on the active sheet, i.e. I can run it from any of 20 different worksheets.

    Thanks

  6. #6
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Use excel form Checkbox and tweak macro to suit.

    So your code would look like
    Please Login or Register  to view this content.

+ 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