Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default If find is true then.....


Hey everyone, quick question. Im looking to have some code that wil
first try to find a value on a page. If it can't find that value, the
it does a set of actions, otherwise, it does a different set of actions
At first I thought to use an If, then, else statement, but I don'
really know how to incorporate the Find condition. If I could get som
help that'd be great. thanks!!

--
jpizzl
-----------------------------------------------------------------------
jpizzle's Profile: http://www.excelforum.com/member.php...fo&userid=2392
View this thread: http://www.excelforum.com/showthread.php?threadid=38277

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default If find is true then.....

Dim rng as Range
Dim sTarget as String

sTarget = "ABCDE"
set rng =Cells.Find(What:=sTarget, _
After:=ActiveCell, _
LookIn:=xlFormulas, _
LookAt:=xlPart, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)
if not rng is nothing then
msgbox "found in cell " & rng.Address
Else
msgbox "Not found"
End Sub


--
Regards,
Tom Ogilvy


"jpizzle" wrote in
message ...

Hey everyone, quick question. Im looking to have some code that will
first try to find a value on a page. If it can't find that value, then
it does a set of actions, otherwise, it does a different set of actions.
At first I thought to use an If, then, else statement, but I don't
really know how to incorporate the Find condition. If I could get some
help that'd be great. thanks!!!


--
jpizzle
------------------------------------------------------------------------
jpizzle's Profile:

http://www.excelforum.com/member.php...o&userid=23920
View this thread: http://www.excelforum.com/showthread...hreadid=382771



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default If find is true then.....


bump bump


--
jpizzle
------------------------------------------------------------------------
jpizzle's Profile: http://www.excelforum.com/member.php...o&userid=23920
View this thread: http://www.excelforum.com/showthread...hreadid=382771

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
How to find first row where condition is true? WhatsUp31415 Excel Discussion (Misc queries) 6 May 21st 09 12:11 PM
Networkdays function doesn't find true difference between two dat sesler2 Excel Worksheet Functions 5 October 5th 06 02:32 PM
Return blank cell if 'find' statement not true Kanga 85 Excel Worksheet Functions 4 May 28th 06 04:25 PM
how do i find a true value between two different times e.g. 4:15 Chris01623 Excel Discussion (Misc queries) 2 August 23rd 05 12:05 PM
VB find (true false) Wildman Excel Worksheet Functions 6 May 6th 05 11:28 AM


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