I need some help!

%3CLINGO-SUB%20id%3D%22lingo-sub-1871797%22%20slang%3D%22zh-CN%22%3EI%20need%20some%20help!%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1871797%22%20slang%3D%22zh-CN%22%3E%3CP%3Ei%20want%20to%20do%20something%20like%20this%3A%3C%2FP%3E%3CP%3Eif%20A1%20is%200xE1%20B1%20is%201%20copy%20A1%20to%20C1%2C%20then%20whatever%20B1%20change%20to%20other%20number%20C1%20doesn't%20change%2C%3C%2FP%3E%3CP%3Ecan%20i%20make%20it%20if%20only%20use%20excel%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1871797%22%20slang%3D%22zh-CN%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1871858%22%20slang%3D%22en-US%22%3ERe%3A%20I%20need%20some%20help!%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1871858%22%20slang%3D%22en-US%22%3E%3CP%3EHello%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F864034%22%20target%3D%22_blank%22%3E%40johnny85824%3C%2FA%3E%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EJust%20so%20I%20am%20understanding%20correctly...%20you%20would%20like%20a%20formula%20in%20cell%20C1%20to%20be%20dependent%20on%20the%20values%20in%20cells%20A1%20and%20B1%20but%20if%20B1%20changes%20and%20a%20value%20was%20already%20printed%20in%20C1%2C%20then%20C1%20should%20not%20change%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
New 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
Highlighted

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?

Highlighted

Hello @PReagan 

 

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

Highlighted

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