LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default String Question

I have a row of data named MyData. The cells contain names as strings, I
want to do an action if the string "Tank" is found in the cell. I wrote the
following code to locate the string within the cell name string (tszName):

TFPos = Application.WorksheetFunction.Find("Tank", tszName,1)

If TFPos 0 Then
Do the action

This code works fine if Tank is in the string. If it is not there, the Find
returns #VALUE!, this stops the macro. I have looked at the other functions
that Excel provides, however all provide some sort of error code if the
string is not found.

Can some one suggest a workaround or a better technique?

Thanks in advance for your help!

Ray


 
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
Excel String question Practiceguys Excel Discussion (Misc queries) 4 January 8th 08 08:49 PM
Change 3 letter text string to a number string Pete Excel Discussion (Misc queries) 3 December 31st 07 07:47 PM
Finding a string/using adjacent data question [email protected] Excel Discussion (Misc queries) 4 January 9th 06 03:59 PM
Create a formula into a String then assign string to a cell Myrna Larson[_2_] Excel Programming 6 August 23rd 03 09:42 PM
Date string question TB[_3_] Excel Programming 1 August 19th 03 09:37 AM


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