![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Feb 2002
Posts: 4
|
I am needing to loop through a series of cells and search for a criteria. The criteria could be something like 'C172' and I want to add that whole row to a range if the cell contains even just the 'C' part or just the '1' part etc. Is there a way to do a wildcard search in vba like
If Range("A:1").Value = "C*" so that I can do something if the value of the cell starts with 'C'? [ This Message was edited by: fly2079 on 2002-02-19 07:56 ] |
|
|
|
|
|
#2 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: Winnipeg
Posts: 2,330
|
Quote:
Code:
If UCase(Left(Range("A1").Value, 1)) = "C" Then 'rest of your code
__________________
Barrie Davidson "You're only given a little spark of madness. You mustn't lose it." - Robin Williams |
|
|
|
|
|
|
#3 |
|
New Member
Join Date: Feb 2002
Posts: 4
|
Ok, now what do I do if I want to search for the numeral 1 or 7 or 172. What this I'm using this for is the user inputs values into a box and I want to have the option of searching for 'contains' in other words search for through and find if part of the value is in the cell. Is this a UDF?
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|