#1   Report Post  
tkaplan
 
Posts: n/a
Default Finding value


I have a user form where the user enters a site number. in the
spreadsheet i have a range names "ValidSites".
After the user enters a site number and clicks on a button, i would
like to validate that that site appears in the ValidSites list.

onclick event()
if txtSiteNumber is found in Range(ValidSites) then
msgbox("found")
else
msgbox("notfound")
endif
endsub

what would be the code for the if statement?

thanks in advance


--
tkaplan
------------------------------------------------------------------------
tkaplan's Profile: http://www.excelforum.com/member.php...o&userid=22987
View this thread: http://www.excelforum.com/showthread...hreadid=478305

  #2   Report Post  
Bernie Deitrick
 
Posts: n/a
Default Finding value

t,

If Not IsError(Application.Match(txtSiteNumber, _
Range("ValidSites"), False)) Then
MsgBox ("Found")
Else
MsgBox ("Not found")
End If

HTH,
Bernie
MS Excel MVP


"tkaplan" wrote in message
...

I have a user form where the user enters a site number. in the
spreadsheet i have a range names "ValidSites".
After the user enters a site number and clicks on a button, i would
like to validate that that site appears in the ValidSites list.

onclick event()
if txtSiteNumber is found in Range(ValidSites) then
msgbox("found")
else
msgbox("notfound")
endif
endsub

what would be the code for the if statement?

thanks in advance


--
tkaplan
------------------------------------------------------------------------
tkaplan's Profile: http://www.excelforum.com/member.php...o&userid=22987
View this thread: http://www.excelforum.com/showthread...hreadid=478305



  #3   Report Post  
tkaplan
 
Posts: n/a
Default Finding value


can these cells be hidden while running this code? the sheet is visible
but the columns that i am searching are hidden.


--
tkaplan
------------------------------------------------------------------------
tkaplan's Profile: http://www.excelforum.com/member.php...o&userid=22987
View this thread: http://www.excelforum.com/showthread...hreadid=478305

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
Filter not finding all cells in columns yowee Excel Worksheet Functions 2 August 12th 05 03:27 AM
Finding Duplicate Names from Different Lists... PokerZan Excel Discussion (Misc queries) 1 July 8th 05 09:58 AM
finding the second largest number in a list bobf Excel Discussion (Misc queries) 1 February 16th 05 01:19 PM
Finding Median if a value = 1.. help! Greg Excel Worksheet Functions 2 February 13th 05 03:28 AM
Finding Cell References Zokess Excel Discussion (Misc queries) 2 February 4th 05 04:52 PM


All times are GMT +1. The time now is 09:19 PM.

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"