Results 1 to 3 of 3

Trying to copy/paste multiple grouped columns across a workbook to another worksheet

Threaded View

mreisbe Trying to copy/paste multiple... 10-24-2013, 03:00 PM
xladept Re: Trying to copy/paste... 10-24-2013, 05:22 PM
xladept Re: Trying to copy/paste... 10-24-2013, 05:23 PM
  1. #1
    Registered User
    Join Date
    10-07-2013
    Location
    New Jersey
    MS-Off Ver
    Excel 2007
    Posts
    1

    Trying to copy/paste multiple grouped columns across a workbook to another worksheet

    Good afternoon. I am trying to write a macro that will take grouped data in columns A&B, C&D, E&F, G&H, ... and paste it one under the other in a new workbook. The data consists of Product Number and Inventory. An example of the data:

    Product Inventory Product Inventory Product Inventory
    A12314 112 A5588 11 B5587 10
    B1158 0 C55478 100 D5587 5

    I want to transpose the data onto a new workbook so I see:
    Product Inventory
    A12314 112
    B1158 0
    A5588 11
    C55478 100
    B5587 10
    D5587 5

    Current vba copies data to new worksheet, but stacks Col A,B,C,D,E,F... in same column.

    Sub SortandGroupData()
    Application.ScreenUpdating = 0
    Dim LC&, i&, ms As Worksheet, j&
    Set ms = Sheets("Test2")
     j = ms.Range("IV2").End(xlToLeft).Column  'Finds last column
     With Sheets("Test")
    
        LC = .Cells.Find("*", , , , xlByColumns, xlPrevious).Column
        
        For i = 1 To LC
    
    '.Cells(2,i) will remove the top row (title row)
          .Cells(2, i).Resize(.Cells(.Rows.Count, i).End(xlUp).Row).Copy
           ms.Cells(Rows.Count, j).End(xlUp).Offset(0).PasteSpecial xlValues
           
        Next i
     End With
    Application.CutCopyMode = 0
    Application.ScreenUpdating = True
    End Sub
    I appreciate any and all help.
    Regards,
    Marc
    Last edited by mreisbe; 10-25-2013 at 04:42 PM. Reason: Updating VBA to comply with rules - thanks for feedback.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Copy/Paste multiple columns as values based on another columns criteria
    By Dgp2012 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-28-2013, 06:50 AM
  2. [SOLVED] Faster way to copy and paste multiple columns in Sheet1 to corresponding columns in Sheet2
    By babbeleme1 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-19-2013, 12:55 AM
  3. Open Multiple Files, Copy Worksheet, Paste in to Specific Tab in Original Workbook
    By freybe06 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-30-2013, 10:27 AM
  4. [SOLVED] Copy multiple worksheets data & paste into blank columns in summary worksheet
    By guest99999 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 03-21-2013, 09:56 AM
  5. Macro to copy and paste columns from one workbook to a new workbook
    By windcloud2 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-05-2012, 11:45 AM

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