+ Reply to Thread
Results 1 to 22 of 22

Split text string into 5 columns

Hybrid View

  1. #1
    Registered User
    Join Date
    01-13-2014
    Location
    xxx
    MS-Off Ver
    xxx
    Posts
    22

    Re: Split text string into 5 columns

    Yudlugar! Thank you so so so much again. This seemed to have worked once but it did it for the whole excel and it ended up Not responding.
    Now, it gives Error '13, where the Debuger says the mistake is on the third line "For count = Selection.Row To Selection.Row + Selection.Rows"
    This is the part that does not compile. I tried to change it to
    "For count = Selection.Row To Selection.Rows"
    But still does not work...
    We are amost there, thenk you so much Yudlugar!

    Sub splitting()
    Dim count
    For count = Selection.Row To Selection.Row + Selection.Rows

    Range("D" & count) = Mid(Range("C" & count), 1, 3)

    Range("E" & count) = Mid(Range("C" & count), 4, 2)

    Range("F" & count) = Mid(Range("C" & count), 6, 1)

    Range("G" & count) = Mid(Range("C" & count), 7, 2)

    Range("H" & count) = Mid(Range("C" & count), 9, 2)

    Next
    End Sub

  2. #2
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Split text string into 5 columns

    FWIW:

    Sub Desree86()
    Dim i As Long
    Dim x As Long
    Dim y As Long
    Dim cl
    y = Selection.Row
    x = Selection.Rows.Count
    For i = x To y Step -1
    Range("D" & i) = Mid(Range("C" & i), 1, 3)
    Range("E" & i) = Mid(Range("C" & i), 4, 2)
    Range("F" & i) = Mid(Range("C" & i), 6, 1)
    Range("G" & i) = Mid(Range("C" & i), 7, 2)
    Range("H" & i) = Mid(Range("C" & i), 9, 2)
    Next i
    End Sub

+ 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. split string into multiple columns
    By bmccall17 in forum Excel General
    Replies: 8
    Last Post: 06-05-2015, 12:27 AM
  2. Advanced Split Function: Need to pull text string in quotes, within a text string
    By Zamboni in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-27-2013, 04:38 PM
  3. Split String into many columns according to Format criteria
    By wali in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 05-23-2010, 01:50 AM
  4. UDF to Split Text String
    By cdrhodes in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-28-2010, 03:40 PM
  5. Split text string to different columns
    By liarliar in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-04-2008, 09:13 AM

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