Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
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
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,420
Default Find cells using wildcards

If c.Value Like "*" & st & "*" Then

--
__________________________________
HTH

Bob

"damorrison" wrote in message
...
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



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 91
Default Find cells using wildcards

Terrific,
Thanks for that
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 91
Default Find cells using wildcards

Great, thanks for that
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
Find and Replace with wildcards? Colin Excel Discussion (Misc queries) 4 January 20th 08 09:05 PM
how to find cells that refer to data in other cells in excel Aman Excel Discussion (Misc queries) 8 December 2nd 07 10:02 PM
Why not accept wildcards for REPLACE as well as FIND ? The Blue Max Excel Discussion (Misc queries) 5 August 10th 07 08:59 AM
Excel custom autofilter- how to find wildcard characters but not as wildcards (e.g. "?") in a cell Keith Excel Discussion (Misc queries) 3 December 22nd 06 02:27 PM
How can I find strings of wildcards in Excel? Nick M Excel Discussion (Misc queries) 2 December 20th 04 05:59 PM


All times are GMT +1. The time now is 04: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"