+ Reply to Thread
Results 1 to 9 of 9

How to mimic ctrl-select using multiple checkboxes on a form

  1. #1
    Registered User
    Join Date
    07-03-2015
    Location
    brisbane
    MS-Off Ver
    2003
    Posts
    28

    Question How to mimic ctrl-select using multiple checkboxes on a form

    I have a userform that is auto populated with checkboxes that correspond to column headings on an activeworksheet.
    what i want to do is click any combination of checkboes, when I click the command button it selects/copy the column(s) the checkbox relates to so I can then click another command button to open a new worksheet and paste the selection.
    Unfortunately my code will only allow me to select one column at a time and not multiple. please help me, I've spent two days trying to get this to work, i think i have to somehow dd each checkbox to an array or range?

    below is the command button
    Please Login or Register  to view this content.
    Last edited by Leith Ross; 07-05-2015 at 07:05 PM. Reason: Added Code Tags

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,646

    Re: How to mimic ctrl-select using multiple checkboxes on a form

    Use a listbox.
    If posting code please use code tags, see here.

  3. #3
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,659

    Re: How to mimic ctrl-select using multiple checkboxes on a form

    Change this...
    Please Login or Register  to view this content.
    To this...
    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  4. #4
    Registered User
    Join Date
    07-03-2015
    Location
    brisbane
    MS-Off Ver
    2003
    Posts
    28

    Re: How to mimic ctrl-select using multiple checkboxes on a form

    OMG.....it worked....thank you so much AlphaFrog
    oops, I have added a heading and would like to only copy from row5 to end of row not entire column, is that possible?

    would this also work with a listbox setup?
    Last edited by vbapadawan; 07-06-2015 at 07:31 AM.

  5. #5
    Registered User
    Join Date
    07-03-2015
    Location
    brisbane
    MS-Off Ver
    2003
    Posts
    28

    Re: How to mimic ctrl-select using multiple checkboxes on a form

    How would you use a listbox to accomplish this task Norie?
    I have started to build one, i have been able to populate the list with the column headings from the activesheet, but am not sure how to link those to the active sheet to make a selection/copy as with the checkboxes;
    i will then have a command button to export the selection to a new sheet, but am unsure how to paste them side-by-side on the new sheet?
    Last edited by vbapadawan; 07-06-2015 at 04:41 PM.

  6. #6
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,659

    Re: How to mimic ctrl-select using multiple checkboxes on a form

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    07-03-2015
    Location
    brisbane
    MS-Off Ver
    2003
    Posts
    28

    Re: How to mimic ctrl-select using multiple checkboxes on a form

    I am So Close AlphaFrog I can taste it, but I do not want to copy the entire column only from row 5 to end row for each selection (my buttons and other data is on row 1 to 4 which I don't want transferred).
    I also have auto filtered abd non-autofiltered information.
    I have another button that exports the entire sheet, but would prefer the listbox feature.
    how can this be acheived?
    the code for the other button is beolw and it workd with filtered or non-filtered sheets
    Please Login or Register  to view this content.

  8. #8
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,659

    Re: How to mimic ctrl-select using multiple checkboxes on a form

    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    07-03-2015
    Location
    brisbane
    MS-Off Ver
    2003
    Posts
    28

    Re: How to mimic ctrl-select using multiple checkboxes on a form

    You're a legend AlphaFrog, thank you so much. I'd shout you a beer if you were here.

+ 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] Ctrl + Select for multiple selection of cells in VBA
    By Slone in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-22-2022, 04:34 PM
  2. .Select selecting multiple sheets in a form
    By Kris_cs1 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 12-20-2014, 12:47 AM
  3. Replies: 3
    Last Post: 11-11-2014, 10:27 AM
  4. Disable cut,copy,paste(including ctrl x, ctrl c n ctrl v)
    By Ramboexcel in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-16-2014, 01:00 AM
  5. Userform coding to mimic Form Button
    By copernicus in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-16-2009, 03:30 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