# If A1 = "TRUE", Then copy the value of A2 to A3

#### jase71ds

##### Board Regular
Hi.
Just as the title says, I need to copy the value of A2 into A3, but only if A1 = "TRUE".
Thanks for any help.

### Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
formula for A3:
=if(A1="True",A2)

formula for A3:
=if(A1="True",A2)

I can't use formula. Here's the long version of what I need...
If the user selects a check box, then "TRUE" is put in cell J32. This part is done.
If the user deselects a check box, then "FALSE" is put in cell J32. This part is done.
I need to assign a macro to the check box, so that whenever the checkbox is toggled by the user, the macro will go and look to see whether the box is checked (TRUE) or unchecked (FALSE). If J32 = TRUE, then I need the values from G13:G14 pasted into G35:36.

So, that's the long answer. I was trying to keep the code simple initially because if someone can give me a solution for pasting the value of A2 into A3 if A1 = TRUE, then I can modify accordingly.

Cant you just put formulas in G35:G36
=IF(J32=TRUE,G13,"")
copy the formula to G36

Cant you just put formulas in G35:G36
=IF(J32=TRUE,G13,"")
copy the formula to G36

Good question, but: No, I can't use a formula. It's complicated to explain, but there are times the user is putting values into G35:G36, and they would, of course, overwrite any forumla.

Okay,
I figured out what was causing my problems. The macro is simple, but the problem is that my check boxes were generating "TRUE" or "FALSE" and I was trying to get the macro to look at these values and behave accordingly. What I discovered is that "TRUE" and "FALSE" (at least when generated by check boxes) are not text -- and even if you format for text, they are not text. So instead of this:
Code:
``````If Range("K35").Value = FALSE Then
or this...
If Range("K35").Value = "FALSE" Then``````
I needed to use this...
Code:
``If Range("K35").Value = 0 Then``

Okay,
I figured out what was causing my problems. The macro is simple, but the problem is that my check boxes were generating "TRUE" or "FALSE" and I was trying to get the macro to look at these values and behave accordingly. What I discovered is that "TRUE" and "FALSE" (at least when generated by check boxes) are not text -- and even if you format for text, they are not text. So instead of this:
Code:
``````If Range("K35").Value = FALSE Then
or this...
If Range("K35").Value = "FALSE" Then``````
I needed to use this...
Code:
``If Range("K35").Value = 0 Then``

If you are using a macro you should post it initially, that will give you the best help. Would have solved it faster for you, however, glad its sorted

If you are using a macro you should post it initially, that will give you the best help. Would have solved it faster for you, however, glad its sorted

Agreed. Sorry for the pains. I was still thrashing through the macro at the time. I'm really slow (but determined). This board has been a huge help to me, and I'm very grateful.

Replies
6
Views
183
Replies
13
Views
335
Replies
1
Views
161
Replies
4
Views
121
Replies
15
Views
401

1,220,987
Messages
6,157,236
Members
451,407
Latest member
vdaesety

### 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.

### Which adblocker are you using?

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

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