Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Search text using wildcards?
I have a macro that performs a loop through a column of text, until th ActiveCell equals a certain value. Below is the relevant section o code. How can I test for any cell that has UserID anywhere in it, suc that it would find text like NWUserId or UserID2? Do Until ActiveCell = "UserID" i = i + 1 ActiveCell.Offset(1, 0).Range("A1").Select Loop Thank Yo -- ackur ----------------------------------------------------------------------- ackurv's Profile: http://www.excelforum.com/member.php...fo&userid=1552 View this thread: http://www.excelforum.com/showthread.php?threadid=27093 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Search text using wildcards?
try:
Do Until InStr(ActiveCell.Value, "UserID") < 0 i = i + 1 ActiveCell.Offset(1, 0).Range("A1").Select Loop -- If I've mis-understood the question please tell me. HTH ijb Remove nospam from my e-mail address to talk direct Not MCSD, MVP, TLA, P&P, PCMCIA, B&Q, etc just trying to help "ackurv" wrote in message ... I have a macro that performs a loop through a column of text, until the ActiveCell equals a certain value. Below is the relevant section of code. How can I test for any cell that has UserID anywhere in it, such that it would find text like NWUserId or UserID2? Do Until ActiveCell = "UserID" i = i + 1 ActiveCell.Offset(1, 0).Range("A1").Select Loop Thank You -- ackurv ------------------------------------------------------------------------ ackurv's Profile: http://www.excelforum.com/member.php...o&userid=15526 View this thread: http://www.excelforum.com/showthread...hreadid=270939 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Search text using wildcards?
Hi, please try this . . .
Sub FindText() With ActiveSheet.Range("A1:D10") Set c = .Find("UserID", LookIn:=xlValues) If Not c Is Nothing Then firstAddress = c.Address Do c.Interior.ColorIndex = 6 Set c = .FindNext(c) Loop While Not c Is Nothing And c.Address < FirstAddress End If End With End Sub Regards, John Mansfield www.pdbook.com -----Original Message----- I have a macro that performs a loop through a column of text, until the ActiveCell equals a certain value. Below is the relevant section of code. How can I test for any cell that has UserID anywhere in it, such that it would find text like NWUserId or UserID2? Do Until ActiveCell = "UserID" i = i + 1 ActiveCell.Offset(1, 0).Range("A1").Select Loop Thank You -- ackurv ---------------------------------------------------------- -------------- ackurv's Profile: http://www.excelforum.com/member.php? action=getinfo&userid=15526 View this thread: http://www.excelforum.com/showthread...hreadid=270939 . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
search for text "beginning with" "containing" wildcards | Excel Worksheet Functions | |||
how do I use wildcards to search between a range of product numb. | Setting up and Configuration of Excel | |||
How do I search without wildcards? | Excel Discussion (Misc queries) | |||
using wildcards on text | Excel Worksheet Functions | |||
Using wildcards within a text box | Excel Programming |