+ Reply to Thread
Results 1 to 3 of 3

Data Split from One Column to Another

Hybrid View

  1. #1
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Data Split from One Column to Another

    Please see the attachment.

    It uses user defined functions to achieve the split.

    Function FirstPart(MyString) As String
    Found = False
    WordArray = Split(MyString, " ")
    For N = 0 To UBound(WordArray)
        If Found = False Then
            For M = 2 To Len(WordArray(N))
                If Mid(WordArray(N), M, 1) = UCase(Mid(WordArray(N), M, 1)) Then
                    Found = True
                    Exit For
                End If
            Next M
        Else
            Exit For
        End If
    Next N
    
    For X = 0 To N - 2
        FirstPart = FirstPart & WordArray(X) & " "
    Next X
    FirstPart = FirstPart & Mid(WordArray(N - 1), 1, M - 1)
    End Function
    
    
    Function SecondPart(MyString) As String
    Found = False
    WordArray = Split(MyString, " ")
    For N = 0 To UBound(WordArray)
        If Found = False Then
            For M = 2 To Len(WordArray(N))
                If Mid(WordArray(N), M, 1) = UCase(Mid(WordArray(N), M, 1)) Then
                    Found = True
                    Exit For
                End If
            Next M
        Else
            Exit For
        End If
    Next N
    
    SecondPart = SecondPart & Mid(WordArray(N - 1), M) & " "
    For X = N To UBound(WordArray) - 1
        SecondPart = SecondPart & WordArray(X) & " "
    Next X
    SecondPart = SecondPart & WordArray(UBound(WordArray))
    
    End Function
    Attached Files Attached Files

+ 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. [SOLVED] Split Merged Data from one column in to 3
    By Trig79 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-22-2012, 02:21 AM
  2. split data in one column into two separate ones
    By C.j. in forum Excel General
    Replies: 6
    Last Post: 03-21-2012, 02:28 PM
  3. Split data from column
    By shijiazhuang in forum Excel General
    Replies: 3
    Last Post: 09-22-2010, 08:31 AM
  4. split the data in 1 column to 3 columns
    By ccs_1981 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-31-2009, 03:39 PM
  5. Split data in column
    By Kat in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-02-2005, 10:20 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