Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Check Box Macro
Hello all,
I need a macro that will allow me to asign a check box to a specific row and when I check the box centain cells in that row will be sent to another sheet. I need to do this with multiple rows on multiple sheets with all info going to one sheet. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Check Box Macro
If you use a checkbox from the forms toolbar
Public Cbox_click() Dim cBox as CheckBox set cBox = Application.Caller Dim rng as Range set rng = Cells(cbox.TopLeftCell,1) rng.Range("A1,D1,F1:H1").Copy Destination:= _ worksheets("Master").Cells(rows.count,1).End(xlup) (2) End Sub assign this to all you checkboxes. Place the checkbox on the row you want it to refer to. Regards, Tom Ogilvy "Jason Watts" wrote in message ... Hello all, I need a macro that will allow me to asign a check box to a specific row and when I check the box centain cells in that row will be sent to another sheet. I need to do this with multiple rows on multiple sheets with all info going to one sheet. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Check Box Macro
Tom
Every time I run the macro I get a Compile error: Invalid outside procedure at Set cBox = Application.Calle |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Check Box Macro
Had a couple of typos in the procedu
Public Sub Cbox_click() Dim cBox As CheckBox Dim rng As Range Set cBox = ActiveSheet.CheckBoxes(Application.Caller) Set rng = Cells(cBox.TopLeftCell.Row, 1) rng.Range("A1,D1,F1:H1").Copy Destination:= _ Worksheets("Master").Cells(Rows.Count, 1).End(xlUp)(2) End Sub Might want to add: Public Sub Cbox_click() Dim cBox As CheckBox Set cBox = ActiveSheet.CheckBoxes(Application.Caller) if cbox.Value = xlOn then Dim rng As Range Set rng = Cells(cBox.TopLeftCell.Row, 1) rng.Range("A1,D1,F1:H1").Copy Destination:= _ Worksheets("Master").Cells(Rows.Count, 1).End(xlUp)(2) End if End Sub Also format the checkbox so, under protection, the choice is "don't move or size with cells" if your checkbox overlaps a cell you are copying (or it might get copied). -- Regards, Tom Ogilvy Jason Watts wrote in message ... Tom, Every time I run the macro I get a Compile error: Invalid outside procedure at Set cBox = Application.Caller |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
check box macro | Excel Discussion (Misc queries) | |||
Macro for check box | Excel Discussion (Misc queries) | |||
Check Box Macro | Excel Discussion (Misc queries) | |||
To be safe - how to check macro before run it? | Excel Discussion (Misc queries) | |||
need macro to check part# and sum | Excel Worksheet Functions |