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

jase71ds

Board Regular
Joined
Oct 23, 2006
Messages
137
Office Version
  1. 365
Platform
  1. Windows
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

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
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.
 
Upvote 0
Cant you just put formulas in G35:G36
=IF(J32=TRUE,G13,"")
copy the formula to G36
 
Upvote 0
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.
 
Upvote 0
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
 
Upvote 0
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 ;)
 
Upvote 0
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.
 
Upvote 0

Forum statistics

Threads
1,213,567
Messages
6,114,344
Members
448,570
Latest member
rik81h

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