excel - copy entire row upon radio button "check"

1.1k views Asked by At

I am looking for the correct macro to program a radio button "checkmark" in A1 to, if checked, copy/share all following fields in that row 1 to another worksheet. I need that destination worksheet to complile a complete list of all items "checked" in the other worksheets... Any help GREATLY appreciated.

1

There are 1 answers

0
JNevill On

A quick high level, since your question is terribly broad:

  1. Add a new checkbox form object on your sheet.
  2. Link that checkbox to the cell behind it by Right-Click>>Format Control>>Control>>Cell Link:
  3. Create a worksheet_change event macro in the Worksheet's vba window that only acts when that particular cell is changed
  4. In that bit of code write the bit to copy the row (something like target.entirerow.copy destination:=Sheet2.Range("A" & target.row))
  5. _
  6. Profit

You'll have to repeat for every row on which you want a checkbox, so this might get a bit tedious, so you may also want to explore how to dynamically add checkboxes to the sheet for each row you have. There's also other ways of doing this with activeX controls, but this seems like a nice use for form controls.

Once you get into the nitty gritty and have a more specific question like "I have a cell A1 that will get a value of either TRUE or FALSE. When it changes I want to trigger a macro in which I will copy that row. How would I trigger that macro when the cell value changes", then toss it on SO.