C
Cynthia
Hi everybody,
I've got an issue that I am racking my brains out but am no closer to a
solution. Appreciate if anyone can help.
Currently I have to import a .txt file into excel as text.
Sometimes my source file contains funny characters instead of proper digits
such as "²", "±", "´" which are not consistent.
I'll like to be able run a macro that highlights the row that contains any
characters which are not proper digits.
E.g. in my column d, i get 0715±0042736 in a certain row, I want to
highlight it.
Got error when I tried this but cant think of a workaround:
Sub Color()
Dim R As Range
Dim V As Variant
Dim S As String
S = "1,2,3,4,5,6,7,8,9,0" '<<<< This is the data to test against
V = Split(S, ",")
For Each R In Range("d1:d500") '<<<< This is the range with data
If InStr(R, V) Then
cell.EntireRow.Interior.ColorIndex = 3
Else
cell.EntireRow.Interior.ColorIndex = 0
End If
Next R
End Sub
Thanks a lot for any assistance!
I've got an issue that I am racking my brains out but am no closer to a
solution. Appreciate if anyone can help.
Currently I have to import a .txt file into excel as text.
Sometimes my source file contains funny characters instead of proper digits
such as "²", "±", "´" which are not consistent.
I'll like to be able run a macro that highlights the row that contains any
characters which are not proper digits.
E.g. in my column d, i get 0715±0042736 in a certain row, I want to
highlight it.
Got error when I tried this but cant think of a workaround:
Sub Color()
Dim R As Range
Dim V As Variant
Dim S As String
S = "1,2,3,4,5,6,7,8,9,0" '<<<< This is the data to test against
V = Split(S, ",")
For Each R In Range("d1:d500") '<<<< This is the range with data
If InStr(R, V) Then
cell.EntireRow.Interior.ColorIndex = 3
Else
cell.EntireRow.Interior.ColorIndex = 0
End If
Next R
End Sub
Thanks a lot for any assistance!