Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > microsoft.public.excel.programming > #108871

Re: MID and FIND function in vba

Newsgroups microsoft.public.excel.programming
Date 2016-06-04 14:47 -0700
References <dc48a761-16d6-4294-ab8f-0a7c927ea178@googlegroups.com> <nitvcj$8b6$1@dont-email.me> <niue24$lji$1@dont-email.me> <niuemq$nqf$1@dont-email.me>
Message-ID <77af7cce-243b-4353-86f4-d7d544c19476@googlegroups.com> (permalink)
Subject Re: MID and FIND function in vba
From "L. Howard" <lhkittle@comcast.net>

Show all headers | View raw


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

Back to microsoft.public.excel.programming | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

MID and FIND function in vba "L. Howard" <lhkittle@comcast.net> - 2016-06-03 17:16 -0700
  Re: MID and FIND function in vba GS <gs@v.invalid> - 2016-06-04 03:18 -0400
    Re: MID and FIND function in vba GS <gs@v.invalid> - 2016-06-04 07:29 -0400
      Re: MID and FIND function in vba GS <gs@v.invalid> - 2016-06-04 07:40 -0400
        Re: MID and FIND function in vba "L. Howard" <lhkittle@comcast.net> - 2016-06-04 14:47 -0700
          Re: MID and FIND function in vba GS <gs@v.invalid> - 2016-06-04 17:56 -0400
            Re: MID and FIND function in vba "L. Howard" <lhkittle@comcast.net> - 2016-06-04 20:18 -0700
              Re: MID and FIND function in vba GS <gs@v.invalid> - 2016-06-05 04:20 -0400
                Re: MID and FIND function in vba "L. Howard" <lhkittle@comcast.net> - 2016-06-05 02:07 -0700
                Re: MID and FIND function in vba GS <gs@v.invalid> - 2016-06-05 07:08 -0400
  Re: MID and FIND function in vba Claus Busch <claus_busch@t-online.de> - 2016-06-04 09:22 +0200
  Re: MID and FIND function in vba GS <gs@v.invalid> - 2016-06-04 03:22 -0400
    Re: MID and FIND function in vba "L. Howard" <lhkittle@comcast.net> - 2016-06-04 02:57 -0700
      Re: MID and FIND function in vba Claus Busch <claus_busch@t-online.de> - 2016-06-04 12:25 +0200
        Re: MID and FIND function in vba "L. Howard" <lhkittle@comcast.net> - 2016-06-04 03:55 -0700
          Re: MID and FIND function in vba Claus Busch <claus_busch@t-online.de> - 2016-06-04 13:16 +0200
            Re: MID and FIND function in vba Claus Busch <claus_busch@t-online.de> - 2016-06-04 13:22 +0200
            Re: MID and FIND function in vba "L. Howard" <lhkittle@comcast.net> - 2016-06-04 14:38 -0700

csiph-web