+ Reply to Thread
Results 1 to 6 of 6

automate 5 lines in a single column to 5 columns across

  1. #1

    automate 5 lines in a single column to 5 columns across

    I want to build a database.
    I've extracted some text from my group's phone directory. It comes
    out in one column with name on the first line, address on the second
    line, city, state, zip on the third line and phone on the fourth line.
    I'm trying to figure out a way to automate getting the info broken up
    into columns.
    I want to create a formula that will allow me to highlight 4 or 5 lines
    and then break those lines into 4 or 5 columns.
    My list has hundeds of names so cut and paste is a bit tedious.
    Is there such a way to do this?


  2. #2
    Bob Phillips
    Guest

    Re: automate 5 lines in a single column to 5 columns across

    This should work with a single-block selection

    Sub ReOrder()
    Dim i As Long

    For i = Selection.Rows.Count To 2 Step -1
    Selection(1, 1).Offset(0, i - 1).Value = Selection(i, 1).Value
    Selection(i, 1).EntireRow.Delete
    Next i
    End Sub


    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    <[email protected]> wrote in message
    news:[email protected]...
    > I want to build a database.
    > I've extracted some text from my group's phone directory. It comes
    > out in one column with name on the first line, address on the second
    > line, city, state, zip on the third line and phone on the fourth line.
    > I'm trying to figure out a way to automate getting the info broken up
    > into columns.
    > I want to create a formula that will allow me to highlight 4 or 5 lines
    > and then break those lines into 4 or 5 columns.
    > My list has hundeds of names so cut and paste is a bit tedious.
    > Is there such a way to do this?
    >




  3. #3
    Alan Beban
    Guest

    Re: automate 5 lines in a single column to 5 columns across

    Why do you say "4 or 5 lines" into "4 or 5 columns"? Your illustration
    indicates you need only 4 lines into 4 columns.

    Alan Beban

    [email protected] wrote:
    > I want to build a database.
    > I've extracted some text from my group's phone directory. It comes
    > out in one column with name on the first line, address on the second
    > line, city, state, zip on the third line and phone on the fourth line.
    > I'm trying to figure out a way to automate getting the info broken up
    > into columns.
    > I want to create a formula that will allow me to highlight 4 or 5 lines
    > and then break those lines into 4 or 5 columns.
    > My list has hundeds of names so cut and paste is a bit tedious.
    > Is there such a way to do this?
    >


  4. #4

    Re: automate 5 lines in a single column to 5 columns across

    some addresses have an extra line


  5. #5

    Re: automate 5 lines in a single column to 5 columns across

    OK. I'm new at this so bear with me. I did some web searches in trying
    to figure out where to start. I found the Tools>Macros>VBE function. Am
    I close? I copied your formula and pasted it into the window I got when
    I double clicked on my worksheet in the VBE window. I selected "Run"
    and got an error message :Compile Error, Syntax Error. Am I at all
    close? What did I do wrong? Did I do ANYTHING right? ;-)


  6. #6
    Bob Phillips
    Guest

    Re: automate 5 lines in a single column to 5 columns across

    Where did you get the error?

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    <[email protected]> wrote in message
    news:[email protected]...
    > OK. I'm new at this so bear with me. I did some web searches in trying
    > to figure out where to start. I found the Tools>Macros>VBE function. Am
    > I close? I copied your formula and pasted it into the window I got when
    > I double clicked on my worksheet in the VBE window. I selected "Run"
    > and got an error message :Compile Error, Syntax Error. Am I at all
    > close? What did I do wrong? Did I do ANYTHING right? ;-)
    >




+ 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