Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Search within a single cell for a character
Using VBA I want an If/Then statement to search within a single cell (D59) to
find if the ":" (colon character) exists after the fourth character. If not "Then: Wrong = True" In an adjacent worksheet cell I could just enter =iserr(find(":",D59,4)) and if the result is True then I know it doesn't exist. How do I write this in VBA? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Search within a single cell for a character
If Instr(5, Range("D59"), ":") 0 then Wrong = True
"AZSteve" wrote: Using VBA I want an If/Then statement to search within a single cell (D59) to find if the ":" (colon character) exists after the fourth character. If not "Then: Wrong = True" In an adjacent worksheet cell I could just enter =iserr(find(":",D59,4)) and if the result is True then I know it doesn't exist. How do I write this in VBA? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Search within a single cell for a character
Dang, I really need to learn to read the details more carefully before
posting my reply. This actually should have been: If InStr(5, Range("D59"), ":") = 0 Then Wrong = True or If Not InStr(5, Range("D59"), ":") 0 Then Wrong = True but you probably got the idea anyhow... "B Lynn B" wrote: If InStr(5, Range("D59"), ":") 0 then Wrong = True "AZSteve" wrote: Using VBA I want an If/Then statement to search within a single cell (D59) to find if the ":" (colon character) exists after the fourth character. If not "Then: Wrong = True" In an adjacent worksheet cell I could just enter =iserr(find(":",D59,4)) and if the result is True then I know it doesn't exist. How do I write this in VBA? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
replace a single character WITH FORMAT in a cell | Excel Worksheet Functions | |||
Character Search a cell | Excel Worksheet Functions | |||
Limit the input in a cell to a single character | Excel Programming | |||
How do I perfom a character count in a single cell in Excel? | New Users to Excel | |||
Case sensitive and single character in cell | Excel Programming |