![]() |
Return True if cell contains special character
How do I test if a cell has any of the special characters e.g. *,?,/
Thanks for any help. |
Answer: Return True if cell contains special character
Here's the formatted text:
You can use the following formula to check if a cell contains any of the special characters you mentioned: Formula:
Let me explain how this formula works:
|
Return True if cell contains special character
Try:
Function CellHasSpecChar(c As Range) As Boolean CellHasSpecChar = c.Value Like "*[?/*]*" End Function Sub TestIt() MsgBox CellHasSpecChar(ActiveCell) End Sub Regards, Greg "linglc" wrote: How do I test if a cell has any of the special characters e.g. *,?,/ Thanks for any help. |
Return True if cell contains special character
For ? and / you can use
=ISNUMBER(FIND("/",A2)) etc.. For *, best to use =ISNUMBER(FIND(CHAR(42),A2)) -- HTH Bob Phillips (replace somewhere in email address with gmail if mailing direct) "linglc" wrote in message ... How do I test if a cell has any of the special characters e.g. *,?,/ Thanks for any help. |
Return True if cell contains special character
If you want the test all in one, try
=SUMPRODUCT(--(ISNUMBER(FIND({"*","/","?"},A1))))0 -- HTH Bob Phillips (replace somewhere in email address with gmail if mailing direct) "linglc" wrote in message ... How do I test if a cell has any of the special characters e.g. *,?,/ Thanks for any help. |
All times are GMT +1. The time now is 09:52 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com