HELP. run time error type mismatch.

Martinez

New member
Local time
Today, 09:47
Joined
Dec 10, 2013
Messages
1
I currently have a long row of data in column 'G'. And in this column i need to replace this value for example, 'SP0U 1PLS1M 13L' to 'SP0U 1PLS1M 55L' . However in the column, there are also other types of values. Thus i have this code,

Sub Final2()
Worksheets("partinfo").Select
LR = Range("G" & Rows.Count).End(xlUp).Row

ActiveSheet.Range("$K$1:$K$" & LR).AutoFilter Field:=9, Criteria1:="<>#N/A", Operator:=xlAnd, Criteria2:="<>*0P*"

For Each cell In Range("$G$1:$G$" & LR)
If cell.Value = "SP0U 1PLS1M 13L" Then
cell.Value = "SP25 1PLS1M 55L"
End If
Next cell
End Sub

However i keep getting the type mismatch error at the 'If cell.value = "SP0U 1PLS1M 13L" . Anyone can help? The value itself contains blanks and i am NOT to trim away the blanks.
 

Users who are viewing this thread

Back
Top Bottom