LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 86
Default Highlighting special characters in a string

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!
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Special characters in a string variable [email protected] Excel Programming 1 August 4th 06 08:36 PM
Highlighting blanks via GO TO SPECIAL is not highlighting blank cells - HELP, I'm totally stuck. Jamie Furlong Excel Discussion (Misc queries) 6 August 28th 05 09:27 PM
String Function 'Like' and Special Characters Vagabond Software Excel Programming 3 June 12th 04 02:02 AM
Escape for special characters in string Jag Man Excel Programming 2 January 2nd 04 03:56 AM


All times are GMT +1. The time now is 03:46 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright 2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"