Excel Background
I got 2 excel column and long records of rows. (example only, as I have more than 10 column)
Column A - It is Either "Yes or No" Column B - Is a remark. Can type anything I need
How it works
This is an ordering system, if date is delayed, Column A will show "Yes"
If no Delay, it will show "No"
I need
I need the VBA code to perform the following:
If column B2 contains text "No Delay", Column A2 will change from "Yes" to "No"
What I have tested
Private Sub UpdateColumnA()
Dim x As Long
For x = 4 To 65536
Dim InStr As String
If InStr(1, Sheet1.Range("$M$" & x), "No Delay") Then
Sheet1.Range("$K$" & x) = Sheet1.Range("$K$" & x) & "No"
End If
Next
End Sub
Problem I met above is that, Column A2 "Yes" will become "YesNo". I require to replace the Yes to No instead of adding to the existing text.
And if B2 text "No Delay" does not match exactly, it will not work at all, hence I want it to be non case sensitive, such as "nO Delay" "No DeLAy" will also work.