Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default running a sub when found


hello,

I have an interresting problem. i'm writing a sub that must execute
another sub when the criteria has been met. E.G.
IF worksheetS("test").cells.find("testing") = true then (execute anther
subroutine)

I can't get anything to work.

Regards,

Niek


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default running a sub when found

Niek,

If I understand your problem correctly, try something like

Dim FoundCell As Range
Set FoundCell = Worksheets("Test").Cells.Find("testing")
If Not FoundCell Is Nothing Then
' string found
DoSomething
Else
' string not found
End If


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"solo_razor" wrote in message
...

hello,

I have an interresting problem. i'm writing a sub that must execute
another sub when the criteria has been met. E.G.
IF worksheetS("test").cells.find("testing") = true then (execute anther
subroutine)

I can't get anything to work.

Regards,

Niek


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default running a sub when found

Not the best way but it seems to work.

Sub iffound()
On Error Resume Next
If Worksheets("Sheet5").Cells.Find("ff") = "ff" Then MsgBox "Hi"
End Sub

but this also works
Sub iffound()
On Error Resume Next
If Worksheets("Sheet5").Cells.Find("fff") = "ff" Then MsgBox "Hi"
End Sub

and this doesn't
Sub iffound()
On Error Resume Next
If Worksheets("Sheet5").Cells.Find("ff") = "fff" Then MsgBox "Hi"
End Sub

--
Don Guillett
SalesAid Software

"solo_razor" wrote in message
...

hello,

I have an interresting problem. i'm writing a sub that must execute
another sub when the criteria has been met. E.G.
IF worksheetS("test").cells.find("testing") = true then (execute anther
subroutine)

I can't get anything to work.

Regards,

Niek


------------------------------------------------
~~ Message posted from
http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/



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
No data found Barry Excel Discussion (Misc queries) 1 July 26th 09 10:44 PM
File not found Brettjg Excel Discussion (Misc queries) 2 December 2nd 07 09:46 PM
Macro cannot be found, but it is there? bwilk77 Excel Discussion (Misc queries) 2 April 13th 07 05:56 PM
IF NOT FOUND roy.okinawa Excel Worksheet Functions 5 November 17th 05 03:26 AM
Which Path not found? Tod Excel Programming 3 August 2nd 03 02:03 PM


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