LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 471
Default Text is contained

I want to open a text file and read the file one line at a time. If the line
contains certain text, I want to branch and do something different. I
thought this would work:

If vbLine Like "pork" Then

but if the vbLine is "dog,cat,pork" it fails. How do I evaluate for a
portion of the vbLine variable? Other software I've used has a contains
operator:
vbLine!"pork" would mean does the vbLine contain "pork"
vbLine!!"pork" would mean does the vbLine variable NOT contain "pork"
Is there such a think in VBA?
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding the cell if text is contained within Bizzy Excel Discussion (Misc queries) 1 March 28th 07 02:11 AM
Adding the cell if text is contained within BoniM Excel Discussion (Misc queries) 0 March 28th 07 12:22 AM
Sumif text is contained winthin a longer text string in a cell Johnny M[_2_] Excel Worksheet Functions 3 March 21st 07 02:50 PM
VLOOKUP with value contained within text Farns Excel Worksheet Functions 3 March 13th 07 10:43 PM
Trimming text contained in cells ToddG Excel Programming 2 June 11th 04 07:46 AM


All times are GMT +1. The time now is 04:53 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"