I have set up a macro to clear ' where there appear in column D & E from data that was imported
When running the macro I get type mismatch and the following code is highlighted
I would be appreciated if someone can kindly amend the code so as to clear the ' (apostrophe) wher it appears in Col D & E
When running the macro I get type mismatch and the following code is highlighted
Code:
If Range("D2:E" & lr).Value = "'" Then
I would be appreciated if someone can kindly amend the code so as to clear the ' (apostrophe) wher it appears in Col D & E
Code:
Sub Remove_Unwanted()
Dim lr As Long
lr = Cells(Rows.Count, "A").End(xlUp).Row
If Range("D2:E" & lr).Value = "'" Then
Range("D2:E" & lr).ClearContents
End If
End Sub