View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
GS[_6_] GS[_6_] is offline
external usenet poster
 
Posts: 1,182
Default MID and FIND function in vba

Just a hint...

Dim vData, 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")
For n = 1 to UBound(vData)
.Cells(k, 4) = Split(vData(n, 1), " - ")(1): k = k + 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