I need a VBA solution to look at Column L and if any row contains the word "NULL", copy the word "NULL" to Column "R" then copy whatever is in Column K to Column L.
Dim Myrow As Long
Myrow = 1
While Range("L" & Myrow).Value <> ""
If UCase(Range("L" & Myrow).Value) = "NULL" Then Range("R" & Myrow).Value = "Null"
Range("L" & Myrow).Value = Range("K" & Myrow).Value
Myrow = Myrow + 1
Wend
Regards
fabriciofonseca
Sorry... I forgot to close the "if". Please use the code below:
Dim Myrow As Long
Myrow = 1
While Range("L" & Myrow).Value <> ""
If UCase(Range("L" & Myrow).Value) = "NULL" Then
Range("R" & Myrow).Value = "Null"
Range("L" & Myrow).Value = Range("K" & Myrow).Value
End If
Myrow = Myrow + 1
Wend
swjtx99
ASKER
Hi fabriciofonseca,
Sorry, I just found I have some blanks (empty cells in column L) and the code stops at the first blank. Can this be revised to go from the bottom up or skip any blanks in column L?
Dim Myrow As Long
Myrow = 1
While Range("L" & Myrow).Value <> ""
If UCase(Range("L" & Myrow).Value) = "NULL" Then Range("R" & Myrow).Value = "Null"
Range("L" & Myrow).Value = Range("K" & Myrow).Value
Myrow = Myrow + 1
Wend
Regards