+ Reply to Thread
Results 1 to 2 of 2

Sorting Data in a column

  1. #1
    BigAndy
    Guest

    Sorting Data in a column

    I am trying to extract data that is in a single column to split it into 3
    columns. The data is cyclic and has 3 variables, a time, a data point and a
    random number. These simply run abcabcabcabc down the column and i would
    like to get all of the a's into a column, all of the b's into another column
    and all of the c's into a third column.

    any ideas?

  2. #2
    Bob Phillips
    Guest

    Re: Sorting Data in a column

    VBA?

    Sub Test()
    Dim iLastRow As Long
    Dim i As Long

    iLastRow = Cells(Rows.Count, "A").End(xlUp).Row
    If iLastRow Mod 3 <> 1 Then iLastRow = iLastRow - 1
    If iLastRow Mod 3 <> 1 Then iLastRow = iLastRow - 1
    For i = iLastRow To 1 Step -3
    Cells(i, "C").Value = Cells(i + 2, "A").Value
    Cells(i, "B").Value = Cells(i + 1, "A").Value
    Rows(i + 1).Resize(2).Delete
    Next i

    End Sub


    --
    HTH

    Bob Phillips

    "BigAndy" <[email protected]> wrote in message
    news:[email protected]...
    > I am trying to extract data that is in a single column to split it into 3
    > columns. The data is cyclic and has 3 variables, a time, a data point and

    a
    > random number. These simply run abcabcabcabc down the column and i would
    > like to get all of the a's into a column, all of the b's into another

    column
    > and all of the c's into a third column.
    >
    > any ideas?




+ 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