+ Reply to Thread
Results 1 to 3 of 3

Macro to copy data to another sheet in one line - horizontally

  1. #1
    Registered User
    Join Date
    07-25-2011
    Location
    Malaysia
    MS-Off Ver
    Excel 2003
    Posts
    2

    Macro to copy data to another sheet in one line - horizontally

    Wondering if there is way to copy data from one excel sheet in table format and transform into a single line of data via macro for excel 2007?

    For instance, I have got following data in table format at Sheet1;

    A - B - C
    Date - Name - Amount
    02/03/2011 - John - -20.00
    05/03/2011 - Peter - 30.89
    05/03/2011 - Anthony - 988.00
    .....
    ..
    .


    The macro should eventually will copy data above to another excel sheet (Sheet2) with horizontally (transpose) one continuous with another with added '@' as a separator.

    02/03/2011
    John
    -20.00
    @
    05/03/2011
    Peter
    30.89
    @
    05/03/2011
    Anthony
    988.00
    ...
    ..
    .


    can this be done?

    The recorded macro will look like this;

    Sheets("Sheet1").Select
    Range("A2:C2").Select
    Selection.Copy
    Sheets("Sheet2").Select
    Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _ False, Transpose:=True

  2. #2
    Valued Forum Contributor MaczaQ's Avatar
    Join Date
    06-03-2011
    Location
    Poland
    MS-Off Ver
    Excel 2003 / XP
    Posts
    510

    Re: Macro to copy data to another sheet in one line - horizontally

    Following code should cover your needs
    Please Login or Register  to view this content.
    In attached file you wil find working example.

    Best Regards
    MaczaQ
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    07-25-2011
    Location
    Malaysia
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Macro to copy data to another sheet in one line - horizontally

    Million Thanks MaczaQ, it work like charm :D

+ 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