LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default text within a string

tom just posted this earlier today to help someone out.

see if it helps you

Option Explicit
Dim rng As Range, rng1 As Range
Dim myVar As String
Sub test()
myVar = "this is load1"
Set rng = Range("a1:a13")

Set rng1 = rng.Find(myVar)
If Not rng1 Is Nothing Then
MsgBox myVar & " found at " & rng1.Address
Else
MsgBox myVar & " was not found in " & rng.Address
End If
End Sub

--


Gary


"nelg" wrote in message
...

G'day guys, I know there is a simple answer to this. I am searching a
column of values and want to stop when I hit a certain string of text.
Problem is it will be in larger string.

example: in the below example I find the load case (say load1) but
load1 is in a larger string.

this is load1
401
405
410
417
418
this is load2
404
407
413
415
418
419

thanks for your help.


--
nelg
------------------------------------------------------------------------
nelg's Profile:
http://www.excelforum.com/member.php...o&userid=27771
View this thread: http://www.excelforum.com/showthread...hreadid=495415



 
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
Text string to Numeric string Manikandan[_2_] Excel Discussion (Misc queries) 2 March 12th 09 08:55 AM
Nested formula to search a text string and return specific text Barbie Excel Worksheet Functions 10 February 21st 09 07:40 AM
Change 3 letter text string to a number string Pete Excel Discussion (Misc queries) 3 December 31st 07 07:47 PM
Splitting a text string into string and number mcambrose Excel Discussion (Misc queries) 4 February 21st 06 03:47 PM
want to remove all text characters equal to one character in length from text string [email protected] Excel Worksheet Functions 1 April 18th 05 09:56 PM


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