View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
damorrison damorrison is offline
external usenet poster
 
Posts: 91
Default Find cells using wildcards

Hello,
I am trying to search for partial strings in a cell,

Sub Button1_Click()
Dim r As Range
Dim c As Range
Dim st As String
Set r = Range("A1", Range("A65536").End(xlUp))
st = InputBox("Enter Partial to Search", "Search By Address")
For Each c In r.Cells
If c = "*" & st & "*" Then '----The problem----
MsgBox c.Address
End If
Next c


End Sub

But do not know how to get the wildcard to work