link cells to a vb check box

jmz82

New Member
Joined
Jul 3, 2008
Messages
2
What I want to do is put in a check box that when checked cell A2 has the same thing as A1. I'm not great at vb but I tried something like this: If checkbox1 = true then a2 = a1. I'm not quite sure how to reference the cells or say the last part.
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)

decklun

Board Regular
Joined
Dec 4, 2006
Messages
126
try

If checkbox1.Value = True Then
ActiveSheet.Range("A2").Value = ActiveSheet.Range("A1").Value
End If
 
Upvote 0

jmz82

New Member
Joined
Jul 3, 2008
Messages
2
That worked perfect, one more question.....How would I do a and statement. for instance if checkbox1 is checked a2 = a1 and a4 = a3. Thank you
 
Upvote 0

Forum statistics

Threads
1,190,913
Messages
5,983,531
Members
439,848
Latest member
timmyo

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
Top