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: 1,182
Default MID and FIND function in vba

Revised to suit...

Dim sState$, vData, vTmp, n&, k&

'Load the state - city list into vData,
'Then split each element using the " - " as delimeter
' and dump the 2nd element into colD...

k = 2 '//1st row of data
With Sheets("Sheet1")
sState = .Cells(1, 8).Value
For n = 1 to UBound(vData)
vTmp = Split(vData(n, 1), " - ")(1): k = k + 1
If vTmp(0) = sState Then .Cells(k, 4) = vTmp(1)
Next 'n
End With

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion

---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

 
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
If find function to not find anything Carlos Excel Programming 4 February 14th 08 09:25 AM
Find function using chr gazza67[_2_] Excel Programming 1 September 13th 07 08:42 AM
Need to find a function. MikeCampbell Excel Worksheet Functions 2 January 29th 07 01:40 AM
Find Function kiza[_4_] Excel Programming 2 June 11th 04 02:49 PM
backwards find function to find character in a string of text Ashleigh K. Excel Programming 1 January 14th 04 04:36 PM


All times are GMT +1. The time now is 08:47 AM.

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"