I need some help!

Copper Contributor

i want to do something like this:

if A1 is 0xE1 B1 is 1 then copy A1 to C1 , then whatever B1 change to other number C1 doesn't change,

can i make it happen only use excel?

3 Replies

Hello @johnny85824,

 

Just so I am understanding correctly... you would like a formula in cell C1 to be dependent on the values in cells A1 and B1 but if B1 changes and a value was already printed in C1, then C1 should not change?

Hello @PReagan 

 

Yes , that exactly what you said
i will try some VBA tomorrow , Thx

@johnny85824 

The following VBA code will check for "0xE1" in cell A1 and 1 in cell B1. If true, then cell A1 will be copied and pasted to cell C1. If not, then nothing will be done.

Sub My_Code()
If Range("A1") = "0xE1" _
And Range("B1") = 1 _
Then
Range("A1").Select
Selection.Copy
Range("C1").Select
ActiveSheet.Paste
End If
End Sub

You can assign this code to a button or shortcut key using the Developer tab.