Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Check Box Macro

Tom
Every time I run the macro I get a Compile error: Invalid outside procedure at Set cBox = Application.Calle

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
check box macro Monique Excel Discussion (Misc queries) 1 November 10th 09 05:22 AM
Macro for check box [email protected] Excel Discussion (Misc queries) 2 December 30th 08 08:59 PM
Check Box Macro bjh Excel Discussion (Misc queries) 5 June 24th 08 09:46 PM
To be safe - how to check macro before run it? Eric Excel Discussion (Misc queries) 2 April 21st 06 12:31 AM
need macro to check part# and sum jg53 Excel Worksheet Functions 8 April 13th 06 04:29 PM


All times are GMT +1. The time now is 05:06 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"