Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel VBA: Counting cells that do/don't contain certain text

Status
Not open for further replies.

ceb07

IS-IT--Management
Oct 25, 2006
7
US
I've been doing very basic Excel Visual Basic for a few years but I'm dying with this problem:

I have a column of text (exported from a MSP schedule or other tools into Excel) and in the cells the text contains certain coding (a number followed by "FF","FS",or "SS"). Those codes are separated by commas in the same cell.

I want to know how many cells contain "SS" but do not contain a comma. The Find method in VBA seems restrictive to only one criteria...I can't figure out how to get two or more to work.

I know this is easy to do using filters in excel, but I'm trying desperately to automate it in a macro.

I would appreciate any tips or tricks that someone might be able to provide or a swift kick in the butt to go look at an existing thread; I'm new to the forum.

Thanks, CEB
 
Record a macro of you creating the filter, and then look at the code. It should be possible to recreate in code for your own criteria.

-David
2006 Microsoft Most Valueable Professional (MVP)
2006 Dell Certified System Professional (CSP)
 
You may get more responses in the MS Office forum - this is Visual Basic 5 & 6, not VBA....

Outside of a dog, a book is man's best friend. Inside of a dog it's too dark to read.
 
Thanks genomon, I'll check that out and see what advice I can get.

Otherwise I'll stick to dglienna's suggestion.

I appreciate your help!

CEB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top