LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 852
Default MID and FIND function in vba

Hi Garry,

I get a Type Missmatch on the vTmp(1). The value of vTmp in the Dim statement shows correctly, as does the = vTmp in the code, with the (1) removed.

vTmp(1) = type missmatch
vTmp = "Greybull" but still type missmatch

Howard


'/ revised Garry
Sub my_Instr_Copy_Garry_2()

Dim sState$, vData, vTmp, n&

vData = Range("A2:A" & Cells(Rows.Count, "A").End(xlUp).Row)

With Sheets("Sheet1")
sState = .Cells(1, 8).Value

For n = 1 To UBound(vData)
vTmp = Split(vData(n, 1), " - ")(1)

If vTmp(0) = sState Then .Cells(n + 1, 4) = vTmp(1)

Next 'n

End With
End Sub



 
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"