Results 1 to 3 of 3

Can excels Split() function split a string up at multiple spots?

Threaded View

111StepsAhead Can excels Split() function... 12-14-2011, 02:28 PM
Steffen Thomsen Re: Can excels Split()... 12-14-2011, 02:33 PM
111StepsAhead Re: Can excels Split()... 12-14-2011, 02:36 PM
  1. #1
    Forum Contributor
    Join Date
    04-11-2011
    Location
    Columbus, Ohio
    MS-Off Ver
    Excel 2007
    Posts
    325

    Can excels Split() function split a string up at multiple spots?

    I have been reading about the function here: http://msdn.microsoft.com/en-us/libr...(v=vs.80).aspx However, it doesn't appear to be able to split a string up at multiple places.

    Dim avarSplit As Variant
    LastRow = Cells(Rows.Count, "Y").End(xlUp).Row
    For x = 2 To LastRow
         Range("Y" & LastRow).Select
         avarSplit = Split(Range(ActiveCell.Value, "CC")
         avarSplit = Split(Range(ActiveCell.Value, "CD")
    Next x
    The above is what I am working with. avarSplit is an array which contains 2 values after I split it once.

    If my string was someTextCCsomeOtherText and I did
    avarSplit= Split(Range(ActiveCell.Value, "CC")
    Then I would get an array like ("someText", "someOtherText"). From my tests I am not able to get an in between value.

    Example: someTextCCsomeOtherTextCDsomeMoreText

    where I need to extract the someOtherText. Does anyone have a good way to do this?
    Last edited by 111StepsAhead; 12-14-2011 at 02:36 PM.

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