Replace a cell value or leave what was alread

Closed
Report
-
Posts
1864
Registration date
Sunday June 14, 2009
Status
Contributor
Last seen
August 7, 2021
-
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 reply

Posts
1864
Registration date
Sunday June 14, 2009
Status
Contributor
Last seen
August 7, 2021
803
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