i have some strings in coloumn B2...it is all constant or all cells till the 17th character of the string after which there are codes like FI,WM,MM,CO..etc
i want to check with these codes and give a common code eg
if it is FI or CO then show FICO if it is MM or PUR or show MM etc i have used this code
Dim MODULE As String, i As Integer
i = 2
For i = 2 To 500
If Mid(B2, 18, 2) = "FI" Or Mid(B2, 18, 2) = "CO" Or Mid(B2, 18, 2) = "IM" Then
MODULE = "FICO"
ElseIf Mid(B2, 18, 2) = "MD" Or Mid(B2, 18, 3) = "MM:" Or Mid(B2, 18, 3) = "PUR" Then
MODULE = "MM"
ElseIf Mid(B2, 18, 2) = "QM" Or Mid(B2, 18, 2) = "PP" Or Mid(B2, 18, 2) = "PM" Or Mid(B2, 18, 2) = "PL" Or Mid(B2, 18, 2) = "BM" Then
MODULE = "PP"
ElseIf Mid(B2, 18, 2) = "SD" Then
MODULE = "SD"
ElseIf Mid(B2, 18, 2) = "SR" Then
MODULE = "SRM"
ElseIf Mid(B2, 18, 2) = "" Then
MODULE = ""
ElseIf Mid(B2, 18, 3) = "MM," Or Mid(B2, 18, 2) = "WM" Then
MODULE = "WM"
Else
MODULE = "S&A"
End If
Cells(i, 1).Value = MODULE
Next i
but am getting only S&A
it mayb a syntax error plz help
Bookmarks