Replace a cell value or leave what was alread

Closed
jimparker65 - Nov 21, 2009 at 04:36 PM
venkat1926 Posts 1863 Registration date Sunday June 14, 2009 Status Contributor Last seen August 7, 2021 - Nov 21, 2009 at 08:27 PM
Hello,
I want to replace the value in say cell B11 with value in B6 if B6 is greater than B11. If B11 is >= to B6 I want to leave the value that was in B11 before the IF test. I do not seem to be able to leave the value that was in B11 using the IF function. Help please - Thanks

1 response

venkat1926 Posts 1863 Registration date Sunday June 14, 2009 Status Contributor Last seen August 7, 2021 811
Nov 21, 2009 at 08:27 PM
this needa macro(which is given below and can be modified to suit you)


KEEP THE DATA SAFELY SOMEWHERE SO THAT IT CAN BE RETRIEVED IF NECESSARY

Sub test()
If Range("B6") > Range("B11") Then
Range("b11") = Range("B6")
End If
End Sub
0