LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 185
Default Find a match in a list

Jay

You can do this by setting a range variable, like so

Sub FindData()
Dim WhatToFind As String
Dim fnd As Range
WhatToFind = InputBox("EnterData")
Set fnd = Range("A1:A25").Find(WhatToFind)
If Not fnd Is Nothing Then
MsgBox "I found " & WhatToFind & " at " & fnd.Address
Else
MsgBox "I found nowt"
End If
End Sub

And then testing if it is not 'nothing' after 'setting' it

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
DTHIS
web:
www.excelusergroup.org
web: www.nickhodge.co.uk





"jlclyde" wrote in message
...
When in coding for a macro I am not sure how to look at a value from
an input box (s1) and compare it to a list for possible matches.
(Range("A1:A10") I know how to get it there once this is done, but
for some reason this is kicking my butt.
Thanks for the help,
Jay


 
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 closest text match for each unique entry in a list Nathan_Decker Excel Discussion (Misc queries) 2 September 23rd 07 01:36 AM
Match, Find? Danny Excel Worksheet Functions 1 April 27th 06 01:40 AM
Product list to match price list badgrandntl Excel Discussion (Misc queries) 13 February 2nd 06 02:28 AM
Using MATCH to find the 2nd match, not only 1st MLP Excel Discussion (Misc queries) 4 October 13th 05 11:08 PM
list 1 has 400 names List 2 has 4000. find manes from list 1 on 2 Ed Excel Worksheet Functions 5 September 12th 05 09:48 AM


All times are GMT +1. The time now is 10:53 PM.

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

About Us

"It's about Microsoft Excel"