Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
If a value exists in a range
I am trying to have VBA evaluate the range C3:C100 (name defined as
Type_of_change), and if the value "TEST" exists in any one of those cells, call Macro A, if not, Call Macro B. How do I get VBA to evaluate the range? Thanks Jeff |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
If a value exists in a range
Sub jeffbert()
Set r = Range("C3:C10") wellisit = False For Each rr In r If InStr(rr.Value, "TEST") 0 Then wellisit = True Else End If Next If wellisit Then Call macroa Else Call macrob End If End Sub -- Gary''s Student gsnu200705 "jeffbert" wrote: I am trying to have VBA evaluate the range C3:C100 (name defined as Type_of_change), and if the value "TEST" exists in any one of those cells, call Macro A, if not, Call Macro B. How do I get VBA to evaluate the range? Thanks Jeff |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
If a value exists in a range
if application.Countif(Range("C3:C100"),"Test") 0 then
MacroA else MacroB End if if test is not the sole value of the cell then if application.Countif(Range("C3:C100"),"*Test*") 0 then MacroA else MacroB End if -- Regards, Tom Ogilvy "jeffbert" wrote in message ... I am trying to have VBA evaluate the range C3:C100 (name defined as Type_of_change), and if the value "TEST" exists in any one of those cells, call Macro A, if not, Call Macro B. How do I get VBA to evaluate the range? Thanks Jeff |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
how to lookup if value exists in a range of data? | Excel Worksheet Functions | |||
See if a Range Name exists? | Excel Programming | |||
Check if named range exists! | Excel Programming | |||
Validate Named Range Exists | Excel Programming | |||
how to tell if a named range exists | Excel Programming |