SPLIT function in VBA

  • friends,

    I am working on a MS Access project, where I want to get individual characters of the string. I am trying to use 'split' function for this but was unable.

    Please help for using split function for continuous 14 char length string or any other method?

    Thanks

    CPK

  • Split returns an array of objects into you variable. Do you get an error or anything?

    ALso, what does the data look like beforehand and what do you want to see afterwards?

  • Split depends on there being delimiters in the string else it just returns the string.

    You will need to:

    - determine the len of the string

    intStringLength = len(mystring)

    - grab each character with the mid function in a loop that loops intStringLength number of times. Position the mid function w/ intStringLength

  • Split in VBA for Access will not help you in this case

    The only Mid () function is usefull here:

     

    Dim strText as String

    Dim varChars() as string

    strText="abcdefghijklmn"

    Redim varChars(Len(strText)-1)

    For i=1 to Len(strText)

      varChars(i-1)=Mid(strText,i,1)

    Next i

    Enjoy

    Renat aka Bibigone

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply