I have an excel file where in Column B there are various strings that all start with "CD-0". I am trying to enter my 'if statement' if the cell starts with "CD-0".
Note: the cells that start with "CD-0" are all several cells in the B column merged together (so it should read it in the top cell).
The following is my code;
Note: In my 'IF statement' if I simply put "CD-009" (which is the string in one of the cells), it works.
You can ignore the stuff in the 'If statement'
Thanks in advance,
- Jeff
Note: the cells that start with "CD-0" are all several cells in the B column merged together (so it should read it in the top cell).
The following is my code;
Code:
For k = 5 To NumRows
If wkb.Worksheets("MESL").Cells(k, 2) = ("CD-0" & "*.*") Then
wkb.Worksheets("Summary - Hours").Cells((i + 2), 2) = wkb.Worksheets("MESL").Cells(k, 2)
MsgBox (wkb.Worksheets("MESL").Cells(k, 2) & " " & k)
i = i + 1
End If
Next k
Note: In my 'IF statement' if I simply put "CD-009" (which is the string in one of the cells), it works.
You can ignore the stuff in the 'If statement'
Thanks in advance,
- Jeff