+ Reply to Thread
Results 1 to 7 of 7

macro to copy a column and put it underneath another

  1. #1
    Registered User
    Join Date
    05-27-2007
    Posts
    10

    Question macro to copy a column and put it underneath another

    On my example spreadsheet attached, i need to copy column f,g and h and paste those columns below the end values of b,c and d. Then I need h1 value to be copied all the way down on the e column until the end of values. Then i need to copy all of b,c,d and e to another worksheet. I have about 8 worksheets and would like it to perform this function on each worksheet and display results one under the other.

    It is kind of complicated and i don't know if it can be done or not?

    I get pricing from my distributor and they send it in a weird excel format where a=LIST#, b=ITEM NO, c=DESCRIPTION, d=PRICE, then another set e=List#, f=Item no, g=Description, h=Price. What I need is the second set f,g, and h to be under b,c, and d. I don't need List#. Then I need for example sheet 1 = Mothboards at h1 to be copied all the way down on column e until the end.
    Attached Files Attached Files

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

    Try

    Please Login or Register  to view this content.

    HTH

    rylo

  3. #3
    Registered User
    Join Date
    05-27-2007
    Posts
    10

    Question

    Thats exactly what I want, thanks.

    One quick question, I have several sheets in a workbook and I need to do that to each sheet and then copy the contents a,b,c,d and e to another worksheet named master. In master have each worksheet copied under each other.

    Also, is there anyway to remove the grey bars?

    Is there a way to do this?

    thanks again for your help.

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

    Added code to remove the grey bars (ie blank rows).

    Please Login or Register  to view this content.
    If you workbook had a constant structure (say summary sheet as the first sheet and the others were data sheets) then you could put in a loop to work from sheets 2 to sheets.count, perform the above actions, then copy the resulting data to the summary sheet.

    Would that be viable?


    rylo

  5. #5
    Registered User
    Join Date
    05-27-2007
    Posts
    10

    Smile

    thanks for the quick response

    i do have merge macro from a tutorial that seems to work fine. http://www.rondebruin.nl/copy2.htm

    Using this macro I can copy all the worksheets together and put them into one.

    How each work sheet is setup, they are all structured the same and are named memory, cpu, hard drives, motherboards etc. I can do each work sheet manually but what I am wondering and would make it easier if i can loop your code to run on memory, cpu, hard drives, motherboards and do it all at once instead of manually doing each one? I don't know maybe run it as a full workbook?

    If you need me to I can attach an example of each of the sheets for you. Or if any other information that you need from me?

    thanks again for yor help,

    This is an excellent forum.

  6. #6
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Wouldn't it be simpler to have everything on one sheet with a column to define CPu etc. Then you can use AutoFilter or PivotTables
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

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

    As I said, if all your data sheets, and the output sheet are in the same workbook, you could loop for all the data sheets, and include code to copy the output to the summary sheet.


    rylo

+ 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