Thanks for the replies
I've tried a different approach, I'm getting some output but it's not correct.
i = 15
j = 15
Do While Cells(i, 1) <> ""
MyMonth = Left(Cells(i, 5), 5)
For Each Cell In Range("ae15:ae40")
If InStr(1, Cell, MyMonth) Then
Cells(i, 6) = Cells(j, 29)
Exit For
Else
j = j + 1
End If
Next
i = i + 1
Loop
This is the input (I'm taking the first five characters):
Jul14Aug
Jul14Aug
Jul14
Jul14
Jul14-Aug
Jun14-Dec
And comparing it to these two columns:
Jan14 25
Feb14 32
Mar14 123
Apr14 32
May14 23
Jun14 233
Jul14 231
Aug14 123
The idea is to take find the corresponding month, and then copy the number beside the corresponding month, and place it beside the original input.
So this input:
Jul14Aug
Jul14Aug
Jul14
Jul14
Jul14-Aug
Jun14-Dec
Would produce this output:
Jul14Aug 231
Jul14Aug 231
Jul14 231
Jul14 231
Jul14-Aug 231
Jun14-Dec 233
Bookmarks