+ Reply to Thread
Results 1 to 8 of 8

*UPDATE* Rows of data to Columns of data *UPDATE*

  1. #1
    Registered User
    Join Date
    05-03-2010
    Location
    Adelaide
    MS-Off Ver
    Excel 2003
    Posts
    3

    Exclamation *UPDATE* Rows of data to Columns of data *UPDATE*

    Thanks for the help so far, thou a slight change......

    So far the VBS works fine BUT needs to be altered, something a little more advanced.
    it was quite easy to understand how the VBS pulls the data but how can it skip a column of data and a column to add the number "000" to the front of the accountID.???

    new test excel file attached.

    thanks once again!!!
    _lex

    -------------------------------------------------------------------------------------------------------------
    Hi all,

    Such a wonderful site here,
    but for the life of me, i can not work out how to setup a Macro or VBS to convert my simple rows of data to making it columns of data.

    Problem is:
    a) program scans 3x fields of data in (per page), then out puts it to a excel file.
    b) each field is on a different row i.e. name\date\code.
    c) each other page continues after the last row.
    d) 100 pages are scanned in.

    Question being, is there a easy way to output this data so it reads\shows in Columns rather than Rows.

    Any bit of help would go along way!

    Attached is a dummy file which shows the way the data is entered and how it should look like in the end.

    thanks for your time!
    Attached Files Attached Files
    Last edited by a6ela; 05-04-2010 at 02:49 AM.

  2. #2
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Rows of data to Columns of data

    Hi

    The above can be obtained using formulas.

    E1: =IF((ROW()-1)*3>=COUNTA(A:A),"",OFFSET($A$1,(ROW()-1)*3,0))
    F1: =IF(E1="","",OFFSET($A$1,((ROW()-1)*3)+1,0))
    G1: =IF(E1="","",OFFSET($A$1,((ROW()-1)*3)+2,0))

    Copy down to match the relevant data.

    If you do really need a macro then try

    Please Login or Register  to view this content.

    HTH

    rylo
    Last edited by rylo; 05-03-2010 at 11:50 PM.

  3. #3
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Rows of data to Columns of data

    Hello a6ela,

    Here is an automated VBA solution. The macro below copies the data in column "A" three rows at a time to columns "E:G" as single rows. A button has been added to the worksheet to run the macro.
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  4. #4
    Registered User
    Join Date
    06-28-2009
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Rows of data to Columns of data

    Hi
    Apply this code to attached sample file, if you find this to be working then you can make necessary changes in your original file.
    Please Login or Register  to view this content.
    Hope this helps..
    Last edited by Leith Ross; 05-04-2010 at 01:45 AM. Reason: Added Code Tags

  5. #5
    Registered User
    Join Date
    05-03-2010
    Location
    Adelaide
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Rows of data to Columns of data

    Damn you guys are quick,

    Thanks heaps for the kind help it was greatly appreciated!!
    thou went with Leith's VBS. works like a dream :-)

    cheers

  6. #6
    Registered User
    Join Date
    05-03-2010
    Location
    Adelaide
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: *UPDATE* Rows of data to Columns of data *UPDATE*

    Thanks for the help so far, thou a slight change......

    So far the VBS works fine BUT needs to be altered, something a little more advanced.
    it was quite easy to understand how the VBS pulls the data but how can it skip a column of data and a column to add the number "000" to the front of the accountID.???

    new test excel file attached.

    thanks once again!!!
    _lex

  7. #7
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: *UPDATE* Rows of data to Columns of data *UPDATE*

    Hello a6ela,

    You will need to give me an example of the problem or post an updated workbook that has the problem.

  8. #8
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: *UPDATE* Rows of data to Columns of data *UPDATE*

    Hello a6ela,

    Here is the revised macro. It now adds a "000" prefix to all the account IDs. The columns have been changed to "J,L,N,O". Here is the code that has been added to the attached workbook.
    Please Login or Register  to view this content.
    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)

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