+ Reply to Thread
Results 1 to 7 of 7

Using excel or vba parse text in cells

Hybrid View

welchs101 Using excel or vba parse text... 05-24-2011, 06:36 PM
welchs101 Re: Using excel or vba parse... 05-24-2011, 06:37 PM
MarvinP Re: Using excel or vba parse... 05-24-2011, 07:36 PM
welchs101 Re: Using excel or vba parse... 05-24-2011, 07:50 PM
welchs101 Re: Using excel or vba parse... 05-24-2011, 08:05 PM
welchs101 Re: Using excel or vba parse... 05-24-2011, 08:16 PM
welchs101 Re: Using excel or vba parse... 05-24-2011, 08:17 PM
  1. #1
    Forum Contributor
    Join Date
    12-01-2007
    Location
    USA-North Carolina
    MS-Off Ver
    MS Office 2016
    Posts
    2,712

    Using excel or vba parse text in cells

    I have a list of id's.

    Before After
    AB990131 AB990131
    ABC20030185 20030185
    CDF20040118 20040118
    CDF20040122 20040122
    CDF20020402 20020402
    B162_20050134 20050134
    C954_20040205 20040205


    I need to somehow parse them or manipulate them to go from the "before" to the after. Any ideas?

  2. #2
    Forum Contributor
    Join Date
    12-01-2007
    Location
    USA-North Carolina
    MS-Off Ver
    MS Office 2016
    Posts
    2,712

    Re: Using excel or vba parse text in cells

    disregard table in previous post...........data not correct and very messy. i am enclosing new table in an excel file.
    Attached Files Attached Files

  3. #3
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,368

    Re: Using excel or vba parse text in cells

    Hi welchs101,
    See the attached which seems to work with your sample data. Are they all 6 or 8 character extracts?
    Attached Files Attached Files
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  4. #4
    Forum Contributor
    Join Date
    12-01-2007
    Location
    USA-North Carolina
    MS-Off Ver
    MS Office 2016
    Posts
    2,712

    Re: Using excel or vba parse text in cells

    i think they are all 6 or 8 character extracts.

    Thanks!!!!!!! what you gave works great!!!!!!!!!!

    I love this site!!!!!!!!!! thanks.

  5. #5
    Forum Contributor
    Join Date
    12-01-2007
    Location
    USA-North Carolina
    MS-Off Ver
    MS Office 2016
    Posts
    2,712

    Re: Using excel or vba parse text in cells

    hey, one more thing.

    Do you know the corresponding vba commands to do the same thing?

  6. #6
    Forum Contributor
    Join Date
    12-01-2007
    Location
    USA-North Carolina
    MS-Off Ver
    MS Office 2016
    Posts
    2,712

    Re: Using excel or vba parse text in cells

    Here is the corresponding vba code that i came up with.........

    seems to work..............

    any concerns?

    'junk1 = text string
    If Val(Right(junk1, 8)) > 0 Then
        junk2 = Val(Right(junk1, 8))
    Else: junk2 = Val(Right(junk1, 6))
    End If

  7. #7
    Forum Contributor
    Join Date
    12-01-2007
    Location
    USA-North Carolina
    MS-Off Ver
    MS Office 2016
    Posts
    2,712

    Re: Using excel or vba parse text in cells

    note: junk1 is the text string i want to parse.........


    for example: junk1=MG990131

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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