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