I was given thi code but want to check if a cell contains the characters "ML"'
The string would be for example "235ML" or "126ML" but there could be others.
So i need to check for the cell containing the string "ML" and adapt it to the code below.
I hope that makes sense and Thanks for any help given.
The string would be for example "235ML" or "126ML" but there could be others.
So i need to check for the cell containing the string "ML" and adapt it to the code below.
Code:
Sub Dave()
Dim I As Long
Dim LR As Long
Const FR As Long = 3 'first row
Const CC As Integer = 4 'check column
LR = Cells(Rows.Count, CC).End(xlUp).Row
For I = FR To LR
If Cells(I, 4) = "221JB" Then
If Cells(I, 1) = "Minor" Then Cells(I, 15) = "JOHN W"
If Cells(I, 1) <> "Minor" And Cells(I, 16) = "B1" Or Cells(I, 16) = "B2" _
Or Cells(I, 16) = "T1" Or Cells(I, 16) = "T2" Then Cells(I, 15) = "PAUL"
Else
If Cells(I, 4) = "935JB" Then Cells(I, 15) = "JOHN G"
End If
Next I
End Sub
I hope that makes sense and Thanks for any help given.