Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default 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
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
search for text "beginning with" "containing" wildcards David H Excel Worksheet Functions 1 January 13th 10 01:24 PM
how do I use wildcards to search between a range of product numb. mrkow86 Setting up and Configuration of Excel 0 October 5th 06 03:35 PM
How do I search without wildcards? Dino Excel Discussion (Misc queries) 8 September 27th 06 02:32 PM
using wildcards on text scott Excel Worksheet Functions 1 September 21st 06 05:45 PM
Using wildcards within a text box JENNA Excel Programming 1 January 27th 04 05:00 AM


All times are GMT +1. The time now is 08:33 AM.

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

About Us

"It's about Microsoft Excel"