Hi there, I have a spreadsheet containing first & last names (columns A & B),
up to 10,000 rows and some of the names contain 'foreign' characters - such
as é.
I would like to be able to hightlight all cells that contain a non-standard
character (ie: A-Z, a-z, 0-9) which will allow our admin team to eailly
filter and correct before the data is loaded into the system.
I've been trying to create a macro for this but I can't seem to get a
formula together to include for all the possible special characters.
I'm ok with excel but by no means a whizz, if anyone can offer any advice I
would be most grateful.
Best regards,
Gareth
|
|
0
|
|
|
|
Reply
|
Utf
|
2/4/2010 2:01:01 PM |
|
Try this UDF:
Function standchr(instring)
standchr = True
For i = 1 To Len(instring)
If Not (LCase(Mid(instring, i, 1)) >= "a" And LCase(Mid(instring, i,
1)) <= "z") Then
standchr = False
Exit For
End If
Next i
End Function
Apply conditional formatting with formula
=NOT( standchr(A1))
--
Regards!
Stefi
„Gareth_Evans (InterCall EMEA)” ezt írta:
> Hi there, I have a spreadsheet containing first & last names (columns A & B),
> up to 10,000 rows and some of the names contain 'foreign' characters - such
> as é.
>
> I would like to be able to hightlight all cells that contain a non-standard
> character (ie: A-Z, a-z, 0-9) which will allow our admin team to eailly
> filter and correct before the data is loaded into the system.
>
> I've been trying to create a macro for this but I can't seem to get a
> formula together to include for all the possible special characters.
>
> I'm ok with excel but by no means a whizz, if anyone can offer any advice I
> would be most grateful.
>
> Best regards,
>
> Gareth
|
|
0
|
|
|
|
Reply
|
Utf
|
2/4/2010 2:36:01 PM
|
|
I've managed to get the following VBA code from another user and ameded
slightly for my use - this brings up a text box which shows the cell
reference and contents in a pop up message box.
Is there a way I can replace "'find é in text" with a generic statement
which checks for all characters that aren't A-Z, a-z 0-9? The only other
alternative would be to type them all out?
How can I highlight a cell containing one of these un-required characters
with a yellow background (or any colour) instead of it popping up in a
message box?
Best regards,
Gareth
Sub FindCellsWithAsterisks()
'find é in text
Dim cell As Range, FirstAddress As String, FoundList As String
With ActiveSheet.UsedRange
'use tilde to find é
Set cell = .Find("~é", LookIn:=xlValues, SearchOrder:=xlByRows, _
LookAt:=xlPart)
If Not cell Is Nothing Then
FirstAddress = cell.Address '< Bookmark start point
Do
FoundList = FoundList & "Cell " & cell.Address(0, 0) & _
" =" & vbTab & cell & vbNewLine
Set cell = .FindNext(cell)
Loop Until cell Is Nothing Or cell.Address = FirstAddress
End If
End With
'show search results
MsgBox FoundList
Set cell = Nothing
End Sub
|
|
0
|
|
|
|
Reply
|
Utf
|
2/4/2010 2:38:01 PM
|
|
Thanks for this one Steffi, for some reason it keeps erroring out :(
'If not.....' line is in red, as is the 1)) and the "Apply" string and the
=not.
I tried putting the ' infront of the commands but it's not running. I'm not
exactly sure what I'm doing wrong, I'm a bit of a novice at VBA.
Best regards,
Gareth
|
|
0
|
|
|
|
Reply
|
Utf
|
2/4/2010 2:46:10 PM
|
|
Hi Stefi, I've managed to get this working (not so much the conditional
format section though), the VBA had a return value in that I removed and it's
all ok.
Thanks for the suggestion, it goes some way to sorting this out but it's not
exactly what I was after.
If anyone else has any other suggestions on this, I've googled all day and
there are folks who want to identify these characters (but with varying end
reults, most want to auto replace or remove but I don't).
I'm sure it's a pretty simple code but it may take a while to get all the
characters written in. If this is the case, if someone can start me off I'll
happily carry on :)
Many thanks,
Gareth
"Stefi" wrote:
> Try this UDF:
>
> Function standchr(instring)
> standchr = True
> For i = 1 To Len(instring)
> If Not (LCase(Mid(instring, i, 1)) >= "a" And LCase(Mid(instring, i,
> 1)) <= "z") Then
> standchr = False
> Exit For
> End If
> Next i
> End Function
>
> Apply conditional formatting with formula
> =NOT( standchr(A1))
>
>
>
> --
> Regards!
> Stefi
>
>
>
> „Gareth_Evans (InterCall EMEA)” ezt írta:
>
> > Hi there, I have a spreadsheet containing first & last names (columns A & B),
> > up to 10,000 rows and some of the names contain 'foreign' characters - such
> > as é.
> >
> > I would like to be able to hightlight all cells that contain a non-standard
> > character (ie: A-Z, a-z, 0-9) which will allow our admin team to eailly
> > filter and correct before the data is loaded into the system.
> >
> > I've been trying to create a macro for this but I can't seem to get a
> > formula together to include for all the possible special characters.
> >
> > I'm ok with excel but by no means a whizz, if anyone can offer any advice I
> > would be most grateful.
> >
> > Best regards,
> >
> > Gareth
|
|
0
|
|
|
|
Reply
|
Utf
|
2/4/2010 5:43:03 PM
|
|
� is not really a "foreign" character.
You say "standard characters that aren't A-Z, a-z, 0-9"
What about other standard chars like , . ? " ' ( ) $ % @ * /
In a blank sheet in A1 enter =CHAR(ROW()) and copy down to A255 and see the
characters produced.
Which of those characters would you consider as "foreign"?
Perhaps we can narrow it down to a series like char(192) through char(255)
Gord Dibben MS Excel MVP
Taking you literally.....use this macro but you will get many hits that are
not "foreign" characters.
On Thu, 4 Feb 2010 06:01:01 -0800, Gareth_Evans (InterCall EMEA)
<GarethEvansInterCallEMEA@discussions.microsoft.com> wrote:
>Hi there, I have a spreadsheet containing first & last names (columns A & B),
>up to 10,000 rows and some of the names contain 'foreign' characters - such
>as �.
>
>I would like to be able to hightlight all cells that contain a non-standard
>character (ie: A-Z, a-z, 0-9) which will allow our admin team to eailly
>filter and correct before the data is loaded into the system.
>
>I've been trying to create a macro for this but I can't seem to get a
>formula together to include for all the possible special characters.
>
>I'm ok with excel but by no means a whizz, if anyone can offer any advice I
>would be most grateful.
>
>Best regards,
>
>Gareth
|
|
0
|
|
|
|
Reply
|
Gord
|
2/4/2010 7:31:52 PM
|
|
Hi Gord, thank you for your reply and sorry for not defining correctly.
The name strings in the two columns, first & last name, can't contain any
characters other than A-Z, a-z, 0-9. No accented characters or symbols. I'd
like to identify these entries with some type of marker so they can be
manually checked.
I'm not looking to auto replace them, just identify them - possibly with a
cell highlight but open to suggestions.
The system we load these names into doesn't support uni-code (yet) and we
get failures on large sheets due to this (we sometimes miss them on the
manual check).
From your instructions I've used =CHAR(ROW()), it's probably easier to list
the one's we'd like to allow as this is a smaller list.
Rows: 46 (full stop), 48-57 (0-9), 65-90 (A-Z) and 97-122 (a-z)
Not quite a sequential series, but could these be grouped maybe?
Thank you for your time, it really is appreciated.
Kind regards,
Gareth
|
|
0
|
|
|
|
Reply
|
Utf
|
2/5/2010 9:54:01 AM
|
|
Hey Stefi - I got your suggestion working, I don't know what I was doing
wrong but your idea was perfect - spot on! Thank you :)
Is there a way I can modify the UDF to allow the following?
A space
A hyphon (-)
Warmest regards,
Gareth
"Stefi" wrote:
> Try this UDF:
>
> Function standchr(instring)
> standchr = True
> For i = 1 To Len(instring)
> If Not (LCase(Mid(instring, i, 1)) >= "a" And LCase(Mid(instring, i,
> 1)) <= "z") Then
> standchr = False
> Exit For
> End If
> Next i
> End Function
>
> Apply conditional formatting with formula
> =NOT( standchr(A1))
>
>
>
> --
> Regards!
> Stefi
>
>
>
> „Gareth_Evans (InterCall EMEA)” ezt írta:
>
> > Hi there, I have a spreadsheet containing first & last names (columns A & B),
> > up to 10,000 rows and some of the names contain 'foreign' characters - such
> > as é.
> >
> > I would like to be able to hightlight all cells that contain a non-standard
> > character (ie: A-Z, a-z, 0-9) which will allow our admin team to eailly
> > filter and correct before the data is loaded into the system.
> >
> > I've been trying to create a macro for this but I can't seem to get a
> > formula together to include for all the possible special characters.
> >
> > I'm ok with excel but by no means a whizz, if anyone can offer any advice I
> > would be most grateful.
> >
> > Best regards,
> >
> > Gareth
|
|
0
|
|
|
|
Reply
|
Utf
|
2/5/2010 12:25:01 PM
|
|
On Fri, 5 Feb 2010 01:54:01 -0800, Gareth_Evans (InterCall EMEA)
<GarethEvansInterCallEMEA@discussions.microsoft.com> wrote:
>Hi Gord, thank you for your reply and sorry for not defining correctly.
>
>The name strings in the two columns, first & last name, can't contain any
>characters other than A-Z, a-z, 0-9. No accented characters or symbols. I'd
>like to identify these entries with some type of marker so they can be
>manually checked.
>
>I'm not looking to auto replace them, just identify them - possibly with a
>cell highlight but open to suggestions.
>
>The system we load these names into doesn't support uni-code (yet) and we
>get failures on large sheets due to this (we sometimes miss them on the
>manual check).
>
>From your instructions I've used =CHAR(ROW()), it's probably easier to list
>the one's we'd like to allow as this is a smaller list.
>
>Rows: 46 (full stop), 48-57 (0-9), 65-90 (A-Z) and 97-122 (a-z)
>
>Not quite a sequential series, but could these be grouped maybe?
>
>Thank you for your time, it really is appreciated.
>
>Kind regards,
>
>Gareth
Perhaps:
===========================
Option Explicit
Sub SpecialChars()
Dim RangeToCheck As Range, c As Range
Set RangeToCheck = Range("A1:B10000")
For Each c In RangeToCheck
If Len(c.Text) > 0 Then
If c.Text Like "*[!.A-Za-z0-9]*" Then
c.Interior.Color = vbRed
Else: c.Interior.Color = vbYellow
End If
End If
Next c
End Sub
===============================
And if there are any other characters, such as a <space> or hyphen or
apostrophe that might be included, you can modify the [!charlist] token above
to include them.
--ron
|
|
0
|
|
|
|
Reply
|
Ron
|
2/5/2010 2:45:41 PM
|
|
Per your request. 0-9, a-z, A-Z and full stop.
Sub Color_Non_Standard()
Dim intI As Integer
Dim rngR As Range, rngRR As Range
Dim strNotNum As String, strTemp As String
Set rngRR = Selection.SpecialCells(xlCellTypeConstants, _
xlTextValues)
For Each rngR In rngRR
strTemp = ""
For intI = 1 To Len(rngR.Value)
If Not Mid(rngR.Value, intI, 1) Like "[A-Z,a-z,0-9,.]" Then
rngR.Interior.ColorIndex = 3
End If
Next intI
Next rngR
End Sub
Gord
On Fri, 5 Feb 2010 01:54:01 -0800, Gareth_Evans (InterCall EMEA)
<GarethEvansInterCallEMEA@discussions.microsoft.com> wrote:
>Hi Gord, thank you for your reply and sorry for not defining correctly.
>
>The name strings in the two columns, first & last name, can't contain any
>characters other than A-Z, a-z, 0-9. No accented characters or symbols. I'd
>like to identify these entries with some type of marker so they can be
>manually checked.
>
>I'm not looking to auto replace them, just identify them - possibly with a
>cell highlight but open to suggestions.
>
>The system we load these names into doesn't support uni-code (yet) and we
>get failures on large sheets due to this (we sometimes miss them on the
>manual check).
>
>From your instructions I've used =CHAR(ROW()), it's probably easier to list
>the one's we'd like to allow as this is a smaller list.
>
>Rows: 46 (full stop), 48-57 (0-9), 65-90 (A-Z) and 97-122 (a-z)
>
>Not quite a sequential series, but could these be grouped maybe?
>
>Thank you for your time, it really is appreciated.
>
>Kind regards,
>
>Gareth
|
|
0
|
|
|
|
Reply
|
Gord
|
2/5/2010 6:56:20 PM
|
|
Stefi, Gord and Ron - thank you all so much for your replies. This has
inspired me to learn VBA properly and write a script that will help one of
our teams even more.
With this sheet I plan to have the cells which contain anything other than
A-Z/0-9/space/Hyphen/' show in red.
Cells in certain columns which can only have a max amount of characters
highlight in blue, an email validation check (for basic format) showing in
red also and to turn all cell contents into 'Case Text'.
I've even got my workbook to close without giving the user an option to save
changes!! I know this is all basic stuff to the pro's but I was so impressed
:)
Thanks again and, if anyone reads this and can recommend helpful reference
material/books for a beginner I'd love to hear from them.
Very best regards,
Gareth
|
|
0
|
|
|
|
Reply
|
Utf
|
2/9/2010 9:45:01 PM
|
|
On Tue, 9 Feb 2010 13:45:01 -0800, Gareth_Evans (InterCall EMEA)
<GarethEvansInterCallEMEA@discussions.microsoft.com> wrote:
>Stefi, Gord and Ron - thank you all so much for your replies. This has
>inspired me to learn VBA properly and write a script that will help one of
>our teams even more.
>
>With this sheet I plan to have the cells which contain anything other than
>A-Z/0-9/space/Hyphen/' show in red.
>Cells in certain columns which can only have a max amount of characters
>highlight in blue, an email validation check (for basic format) showing in
>red also and to turn all cell contents into 'Case Text'.
>
>I've even got my workbook to close without giving the user an option to save
>changes!! I know this is all basic stuff to the pro's but I was so impressed
>:)
>
>Thanks again and, if anyone reads this and can recommend helpful reference
>material/books for a beginner I'd love to hear from them.
>
>Very best regards,
>
>Gareth
Glad to help. Thanks for the feedback.
Hopefully, one of the others will have some references for you.
--ron
|
|
0
|
|
|
|
Reply
|
Ron
|
2/9/2010 11:12:06 PM
|
|
Thanks for the feedback.
As far as books go..................
See Debra Dalgleish's site for a list of books.
http://www.contextures.on.ca/xlbooks.html
Under Functions, anything by John Walkenbach
Under VBA, any of the first three listed and any other by John Walkenbach.
Also Reed Jacobsen books are generally pretty good in my experience.
Gord Dibben MS Excel MVP
On Tue, 9 Feb 2010 13:45:01 -0800, Gareth_Evans (InterCall EMEA)
<GarethEvansInterCallEMEA@discussions.microsoft.com> wrote:
>Stefi, Gord and Ron - thank you all so much for your replies. This has
>inspired me to learn VBA properly and write a script that will help one of
>our teams even more.
>
>With this sheet I plan to have the cells which contain anything other than
>A-Z/0-9/space/Hyphen/' show in red.
>Cells in certain columns which can only have a max amount of characters
>highlight in blue, an email validation check (for basic format) showing in
>red also and to turn all cell contents into 'Case Text'.
>
>I've even got my workbook to close without giving the user an option to save
>changes!! I know this is all basic stuff to the pro's but I was so impressed
>:)
>
>Thanks again and, if anyone reads this and can recommend helpful reference
>material/books for a beginner I'd love to hear from them.
>
>Very best regards,
>
>Gareth
|
|
0
|
|
|
|
Reply
|
Gord
|
2/10/2010 12:33:14 AM
|
|
You are welcome! Thanks for the feedback!
I'd suggest to make use of macro recording, I found it a very useful mean -
together with reading Help - when learning VBA.
--
Regards!
Stefi
„Gareth_Evans (InterCall EMEA)” ezt írta:
> Stefi, Gord and Ron - thank you all so much for your replies. This has
> inspired me to learn VBA properly and write a script that will help one of
> our teams even more.
>
> With this sheet I plan to have the cells which contain anything other than
> A-Z/0-9/space/Hyphen/' show in red.
> Cells in certain columns which can only have a max amount of characters
> highlight in blue, an email validation check (for basic format) showing in
> red also and to turn all cell contents into 'Case Text'.
>
> I've even got my workbook to close without giving the user an option to save
> changes!! I know this is all basic stuff to the pro's but I was so impressed
> :)
>
> Thanks again and, if anyone reads this and can recommend helpful reference
> material/books for a beginner I'd love to hear from them.
>
> Very best regards,
>
> Gareth
|
|
0
|
|
|
|
Reply
|
Utf
|
2/11/2010 10:45:01 AM
|
|
|
13 Replies
1065 Views
(page loaded in 0.357 seconds)
Similiar Articles: Hightlight cells that contain special characters - microsoft ...Hi there, I have a spreadsheet containing first & last names (columns A & B), up to 10,000 rows and some of the names contain 'foreign' characters -... hightlight cells - microsoft.public.excel.miscHightlight cells that contain special characters - microsoft ... Hi there, I have a spreadsheet containing first & last names (columns A & B), up to 10,000 rows and some ... Excel 2007 - Formatting text in cell (character by character ...Hightlight cells that contain special characters - microsoft ... Excel 2007 - Formatting text in cell (character by character ..... one could select a cell, highlight a ... Excel 2003 - Maximum number of characters a cell can contain ...Hightlight cells that contain special characters - microsoft ... Excel 2003 - Maximum number of characters a cell can contain ... That something special is to add alt ... Formula to Remove Special Characters - microsoft.public.excel.misc ...Hightlight cells that contain special characters - microsoft ... Formula to Remove Special Characters - microsoft.public.excel.misc ... Hightlight cells that contain ... Conditional formatting by number of characters in cell - microsoft ...Hightlight cells that contain special characters - microsoft ... i want to set conditional format to cells containing odd numbers ... Hightlight cells that contain special ... Entering LF/CR special characters in a Memo field - microsoft ...Hightlight cells that contain special characters - microsoft ... Entering LF/CR special characters in a Memo field - microsoft ... Hightlight cells that contain special ... Check numeric char - microsoft.public.excel.programming ...Hightlight cells that contain special characters - microsoft ... Excel 2003 - Maximum number of characters a cell can contain ... Check numeric char ... ... characters ... I need to add the letter "Z" to the end of every ...Hightlight cells that contain special characters - microsoft ..... non-standard character (ie: A-Z, a ... That something special is to add alt-enters (to force a new ... Test to see if cell contains a space? - microsoft.public.excel ...Inserting a space between characters in a cell - microsoft.public ... Test to see if cell contains a space? - microsoft.public.excel ... ... Insert A Special Character ... Remove all Characters Remains only Numeric Data - microsoft.public ...... in Column A1:A300000, But the Problem is that in Many Cell there are Unused and Special Character ... > If cell A1 contains: A123BCD456EF789G and in B1 you'll type =GN(A1 ... Inserting a space between characters in a cell - microsoft.public ...Hightlight cells that contain special characters - microsoft ... Inserting a space between characters in a cell - microsoft.public ... Test to see if cell contains a space ... Return cell characters after space - microsoft.public.excel ...Hightlight cells that contain special characters - microsoft ..... space? - microsoft.public.excel ..... that CONTAIN space?? > >For an Example, COLOUMN A1-A1000 contains ... Special Character (Check Mark) in a Report - microsoft.public ...Hightlight cells that contain special characters - microsoft ... Special Character (Check Mark) in a Report - microsoft.public ... Hightlight cells that contain special ... Shading cells that contain formulas and conditional formatting at ...Hightlight cells that contain special characters - microsoft ... > >Thank you for your time ... Cell; Highlight Cells If Duplicate Found On The Same Row ... Macro code to partially format font colour of result in cell ...Hightlight cells that contain special characters - microsoft ... How can I highlight a cell containing ... that ... in cell (character by character ... Some cells or styles in this workbook contain formatting that is ...Hightlight cells that contain special characters - microsoft ... > > I've even got my workbook to close without giving the user an option to ... Some of the cells contain ... replace a single character WITH FORMAT in a cell - microsoft ...Hightlight cells that contain special characters - microsoft ... replace a single character WITH FORMAT in a cell - microsoft ... Hightlight cells that contain special ... Sorting cells with a string formulas - microsoft.public.excel ...> In trying to split addresses which contain both number and street in one > cell, I have extracted ... Trimming leading character from string and replace underscore with I can't format cells - microsoft.public.excel.miscHightlight cells that contain special characters - microsoft ... I've been trying to create a macro for this but I can't seem to get a formula ... i want to set ... Hightlight cells that contain special characters - microsoft ...Hi there, I have a spreadsheet containing first & last names (columns A & B), up to 10,000 rows and some of the names contain 'foreign' characters -... Hightlight cells that contain special charactersHi there, I have a spreadsheet containing first & last names (columns A & B), up to 10,000 rows and some of the names contain 'foreign' characters - such Automatically highlight cells with special characters - ExcelBanterExcel Discussion (Misc queries) ... I need to flag cells that contain numbers with asterixes. Conditional formatting does ... One possibility would be to concatenate ... Return True if cell contains special character - ExcelBanterExcel Discussion (Misc queries) ... How do I test if a cell has any of the special characters e.g. *,?,/ Thanks for any help. ... Try: Function CellHasSpecChar(c As ... hightlight cells - microsoft.public.excel.misc | Microsoft NewsgroupsHightlight cells that contain special characters - microsoft ... Hi there, I have a spreadsheet containing first & last names (columns A & B), up to 10,000 rows and some ... Excel :: Conditional Formatting Counting Characters If Less Than X ...... any function in Excel that counts the # of characters in a cell or will highlight the cells that contain ... such as super and sub scripting) and some special characters ... Excel :: Conditional Formatting With Special CharactersCells in the excel sheet contains special characters like { ) , ( , ’, ; , , , _ , ... } These cells ... formatting for Column D in my spreadsheet to highlight cells that ... Excel - Conditional Formatting For Character Length - Hi I am ...I would like to set it up so those cells highlight when it has more than 40 characters in it. ... can only be 3-5 characters long Word cannot contain special characters ... Excel - Highlight The Cell Value/value - How can i highlight ...Remove All Text,special Characters, & Spaces - Excel ... highlight formula that can highlight the cell within the column that contains the largest number of characters?? Check if a cell contains text - Excel - Office.comThere are several ways to check if a cell contains text but the case of the text doesn ... Note You can use wildcard characters in your search criteria. If you want to ... 7/27/2012 2:15:50 AM
|