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: 192
Default Combining multiple like's with Or?

I'm trying to categorize certain products into one of three segments based on
their name. Since I have about 100 products, I'd rather not write a "like"
statement for each and every product. Is there a way to combine them so I
can do something like the following?

If Range("H2").Offset(i, 0).Value Like "*prod1*" Or "*prod2*" Then
Range("W2").Offset(i, 0).Value = "Segment1"

Currently I get a type mismatch error on the first of the lines shown here.
Any suggestions?

 
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
combining multiple columns from multiple files osiris73 Excel Discussion (Misc queries) 2 January 17th 07 03:30 AM
Help combining multiple columns into one [email protected] Excel Discussion (Misc queries) 8 December 28th 06 09:49 PM
Combining multiple worksheets tina Excel Worksheet Functions 0 September 29th 06 09:48 AM
Combining multiple tabs into one. [email protected] Excel Discussion (Misc queries) 1 July 19th 06 07:15 PM
Combining Text from multiple cells under multiple conditions KNS Excel Worksheet Functions 2 June 15th 05 11:00 PM


All times are GMT +1. The time now is 08:16 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"