Matching Data in VB

  • Thread starter Thread starter Neil
  • Start date Start date
N

Neil

I have a query onto our AS400, & I want to remove some
rows after updating, the actual removal of the rows is
ok, I was just wondering if there was a "contains"
function in VB that would allow me to do something like...

If activecell.value contains "Obselete" then
yada yada yda

In the time It has taken me to fire up IE and write this
I could have written something to run along the string
and look for the values, but I figured it beter to try
and improve myself !!!!!!
 
Hi Neil,

If I understand you correctly, there are a couple of ways to do this,
the most efficient being:

If ActiveCell.Value Like "*Obsolete*" Then
''' Do something.
End If

--
Rob Bovey, MCSE, MCSD, Excel MVP
Application Professionals
http://www.appspro.com/

* Please post all replies to this newsgroup *
* I delete all unsolicited e-mail responses *
 
Neil said:
I have a query onto our AS400, & I want to remove some
rows after updating, the actual removal of the rows is
ok, I was just wondering if there was a "contains"
function in VB that would allow me to do something like...

If activecell.value contains "Obselete" then
yada yada yda

In the time It has taken me to fire up IE and write this
I could have written something to run along the string
and look for the values, but I figured it beter to try
and improve myself !!!!!!


If you wish to check for a particular value with a cell
you can use the instr function


longreturn = InStr([start, ]string1, string2[, compare])

e.g.

If instr(1,Activecell.text,"Obsolete")<>0 then
do my stuff
End If

Keith
 
Back
Top