Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
How can I check with a macro script if the text in a cell contains a question mark? Thanks in advance for any tip or hint. Hans |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Use the InStr() function. Example below will tell you if there's a ? in the
text in cell A1 of the active sheet. Sub HasQuestionMark() If InStr(Range("A1"), "?") Then MsgBox "Found question mark" Else MsgBox "No question mark here!" End If End Sub "H@C0" wrote: Hi, How can I check with a macro script if the text in a cell contains a question mark? Thanks in advance for any tip or hint. Hans |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks for your help.
This was exactly what I was looking for. Hans On Sat, 30 Aug 2008 12:49:00 -0700, JLatham <HelpFrom @ Jlathamsite.com.(removethis) wrote: Use the InStr() function. Example below will tell you if there's a ? in the text in cell A1 of the active sheet. Sub HasQuestionMark() If InStr(Range("A1"), "?") Then MsgBox "Found question mark" Else MsgBox "No question mark here!" End If End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Combine text from multiple cells into one cell - =(A1&","&A2","&A3 | Excel Worksheet Functions | |||
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell | Excel Discussion (Misc queries) | |||
how excel checks a "#" to express it as a text, check if cell is n | Excel Worksheet Functions | |||
Excel: Changing "numeric $" to "text $" in a different cell. | Excel Worksheet Functions | |||
create links to check boxes marked "good" fair"and "bad" | Excel Worksheet Functions |