Hi,
I created a macro in excel by importing XML file and then make amendments and then run to export as textfile. I have a column with specific characters like "A" or "C" as last characters of a string. I want to export that column strings after removing the last "A" or "C" character. My code is this:
'remove MATNR last character if it is "A" or "C"
If Len(ws9B.Cells(iRow, 4).Text) <> 0 Then
If Right(ws9B.Cells(iRow, 4).Text, 1) = "A" Or "C" Then
ws9B.Cells(iRow, 4) = Left(ws9B.Cells(iRow, 4).Text, Len(ws9B.Cells(iRow, 4).Text) - 1)
End If
End If
But i keep on getting type mismatch error for the following code. Please anyone help on this problem. Thank you in advance for any help.