Macro - Checkbox triggers copy/paste

HNelshp

New Member
Joined
Jul 8, 2011
Messages
3
Hello! Background: I mostly use Excel for text tables. :) I can use the Add function, but beyond that ... not so good with formulas. I was given a project that requires more knowledge than I have and could obtain from the websites I've perused. I was hoping you could help.

I have Yes and No checkboxes created in a table. I would like the action of checking "No" to trigger text to be copied from cells on the current spreadsheet to cells on another spreadsheet. Is that doable? So...if someone clicks the "No" checkbox in E7, the text from Spreadsheet 1 A7 and B7 would be automatically copied and pasted onto Spreadsheet 2, A7 and B7...and likewise down the line. "No" in E8 would copy A8 and B8 from Spreadsheet 1 to 2 and so on.

Any help you could give me on this would be greatly appreciated.

Thanks, Heather
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
This should be doable via vba. Are the checkboxes form controls or active x controls (i mean how have they been inserted in the sheet)
 
Upvote 0
I entered as Form Controls. I don't think my boss would mind either way, so that could always be changed. (She knows even less than me...so its easy to impress her. LOL)
 
Upvote 0
So how much time and effort would it take someone to do via VBA? And is it something a novice could do?
 
Upvote 0
if u link your checkbox to its corr cell in col z then every time you check or uncheck the box you wd get a true or false respectively. this should trigger the below code which is to be put in your worksheet(Not module).

But somehow it is not working. Can someone else help.


Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Set isect = Application.Intersect(Range("Z1:Z100"), Target)
If Not (isect) Is Nothing Then
    If Target = "True" Then
        Range("A" & Target.Row & ":B" & Target.Row).Copy Destination:=Sheets("Sheet2").Range("A" & Target.Row)
    End If
End If

End Sub
 
Upvote 0

Forum statistics

Threads
1,224,586
Messages
6,179,710
Members
452,939
Latest member
WCrawford

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top