+ Reply to Thread
Results 1 to 7 of 7

how to process a string into segments retrieved from an array

  1. #1
    Registered User
    Join Date
    07-22-2005
    Location
    canada
    Posts
    73

    how to process a string into segments retrieved from an array

    Hello,

    It's been awhile since I've done some VBA, so my brain is VBrusty...

    I've got a 2 column array that consists of

    Please Login or Register  to view this content.
    I need a button that will process through a specific column and its values, compare the cell's value against the PATH_NAME in the array, if a match is found, apply the matching PATH_VALUE to a variable. (This part, I'm pretty sure I know how to do)

    I than need to process that path_value, and then fill another variable with several variations of the original path_value.

    Its this variations that I need help with.

    Here is an example of a path (and they all follow this pattern pretty consistently).

    Please Login or Register  to view this content.
    What I need to do is have a text field that produces the following out of the above path:

    (I inserted carriage returns to make it easier to read, but it should be just one long string)

    Please Login or Register  to view this content.

    Any help on this would be awesomly appreciated!

  2. #2
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,125

    Re: how to process a string into segments retrieved from an array

    If, in fact, your data is delimited by semicolons, you can use the split function.

    Please Login or Register  to view this content.
    Temp will be a multidimensional array that you can assign.

    E.g.
    Please Login or Register  to view this content.
    If you wanted the third element.
    David
    (*) Reputation points appreciated.

  3. #3
    Registered User
    Join Date
    07-22-2005
    Location
    canada
    Posts
    73

    Re: how to process a string into segments retrieved from an array

    Ok, that seems like what I need (I'll need to test it)

    However, it delimited by "/" not semicolons.

    The issue is that each path do have a variable amount of /'s . So I guess I'll have to loop through the temp array based on its ubound, and then add in a semi-colon after each "result" and keep adding itself to the final output string.

  4. #4
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,125

    Re: how to process a string into segments retrieved from an array

    duplicate post
    Last edited by Tinbendr; 12-16-2016 at 04:18 PM.

  5. #5
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,125

    Re: how to process a string into segments retrieved from an array

    I'm sure there's room for improvement.
    Please Login or Register  to view this content.
    Last edited by Tinbendr; 12-16-2016 at 04:54 PM.

  6. #6
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,125

    Re: how to process a string into segments retrieved from an array

    This ia a tad less convoluted
    Please Login or Register  to view this content.
    .

  7. #7
    Registered User
    Join Date
    07-22-2005
    Location
    canada
    Posts
    73

    Re: how to process a string into segments retrieved from an array

    Thanks TinBendr,

    Thats exactly what I needed to iterate through this.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Take data from array, insert into string, search for string in another array
    By Old4xford in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-12-2015, 02:56 PM
  2. VBA Find Partial String in String Array and Output the Found String Array Value
    By scherich in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-02-2014, 11:20 AM
  3. [SOLVED] Return matching string in array if cell contains string contained in the array
    By AaronsZ in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-03-2013, 01:55 PM
  4. Replies: 3
    Last Post: 08-16-2012, 11:22 AM
  5. How do I take segments (Example, $1 $2 $3) from a text box (or string)???
    By BaLLZaCH in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-17-2008, 08:31 PM
  6. Process and declare a character array
    By nygwnj in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-12-2008, 04:00 PM
  7. [SOLVED] Process a row if a string search finds certain words from a list
    By Reuel in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-26-2005, 10:02 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1