View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
John Mansfield[_2_] John Mansfield[_2_] is offline
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

.