Matching Data in VB

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 !!!!!!
 
R

Rob Bovey

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 *
 
K

Keith Willshaw

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top