Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
String Contains a Value
I would like a certain action to be carried out if a specified string is
found anywhere within the active cell. What code can I use to evaluate the condition? Eg if Customer is found anywhere in the active cell, I want to delete the current row. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
String Contains a Value
if instr(1,cell.Value,"ABC",vbTextcompare) then
cell.EntireRow.Delete end if -- Regards, Tom Ogilvy "Lynn" wrote: I would like a certain action to be carried out if a specified string is found anywhere within the active cell. What code can I use to evaluate the condition? Eg if Customer is found anywhere in the active cell, I want to delete the current row. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
String Contains a Value
If ACtivecell.Value Like "*name*" Then
ACtivecell.Entirerow.Delete End If -- HTH Bob Phillips (replace somewhere in email address with gmail if mailing direct) "Lynn" wrote in message ... I would like a certain action to be carried out if a specified string is found anywhere within the active cell. What code can I use to evaluate the condition? Eg if Customer is found anywhere in the active cell, I want to delete the current row. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
String Contains a Value
Thanks Tom - this worked perfectly
"Tom Ogilvy" wrote: if instr(1,cell.Value,"ABC",vbTextcompare) then cell.EntireRow.Delete end if -- Regards, Tom Ogilvy "Lynn" wrote: I would like a certain action to be carried out if a specified string is found anywhere within the active cell. What code can I use to evaluate the condition? Eg if Customer is found anywhere in the active cell, I want to delete the current row. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Change 3 letter text string to a number string | Excel Discussion (Misc queries) | |||
Importing Long String - String Manipulation (INVRPT) (EDI EANCOM 96a) | Excel Programming | |||
Importing Long String - String Manipulation (EDI EANCOM 96a) | Excel Programming | |||
to search for a string and affect data if it finds the string? | Excel Worksheet Functions | |||
Create a formula into a String then assign string to a cell | Excel Programming |