Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 244
Default Search cell for string

Hi! I search column A in an excel file fo ra certain expression. The
expression might look like: G BP730 080708_88571. However the cell I am
trying to locate will only contain part of this string eg G BP730 080708. How
can I do this? Many thanks!


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Search cell for string

Try this:

Sub arneee()
Dim expression As String, v As String
expression = "G BP730 080708_88571"
Set r = Intersect(Range("A:A"), ActiveSheet.UsedRange)
For Each rr In r
v = rr.Value
If InStr(expression, v) 0 And Len(v) 0 Then
MsgBox (rr.Address & Chr(10) & rr.Value)
Exit Sub
End If
Next
End Sub

--
Gary''s Student - gsnu200754


"Arne Hegefors" wrote:

Hi! I search column A in an excel file fo ra certain expression. The
expression might look like: G BP730 080708_88571. However the cell I am
trying to locate will only contain part of this string eg G BP730 080708. How
can I do this? Many thanks!


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
Search for string of characters in a cell BRB Excel Discussion (Misc queries) 3 August 21st 08 07:44 PM
Search for string in a cell, then hilight the row Chris C Excel Programming 5 November 29th 06 09:49 AM
Using Vlookup in a string search of a cell Ralph Heidecke Excel Worksheet Functions 1 April 26th 06 06:46 PM
search a string withing a string : find / search hangs itarnak[_9_] Excel Programming 4 October 24th 05 03:19 PM
Search for a string sequence in a cell CLS Excel Programming 3 May 6th 05 09:31 PM


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