Results 1 to 5 of 5

Macro to use existing code but paste into next empty column

Threaded View

  1. #1
    Registered User
    Join Date
    06-06-2013
    Location
    Wisconsin
    MS-Off Ver
    Excel 2010
    Posts
    38

    Macro to use existing code but paste into next empty column

    Hi everyone, thanks to your help I've been able to get this far. But I just have one more question.

    Here is my current code:

    Sub Trend()
    Application.ScreenUpdating = 0
    Dim LC&, i&, ms As Worksheet
    Set ms = Sheets("08ITEMHISTORY")
     With Sheets("07ITEMMETRICS")
     
        LC = .Cells.Find("*", , , , xlByColumns, xlPrevious).Column
        For i = 6 To LC
          .Cells(1, i).Resize(.Cells(.Rows.Count, i).End(xlUp).Row).Copy
           ms.Range("A" & Rows.Count).End(xlUp).Offset(1).PasteSpecial xlValues
        Next i
     End With
    Application.CursorMovement = 0
    Application.ScreenUpdating = True
    End Sub
    It's taking multiple columns from a specific worksheet and pasting them into one column on a different worksheet.

    But I need to be able to run the macro several times and each time have it paste into the next empty column.
    So say after running the macro three times I have three separate columns.

    As of right now the macro just pastes the data beneath the same column instead of moving over.
    I think this belongs in the code somewhere: End(xlToLeft).Offset(0, 1).Select

    I just can't figure it out.
    Thank you in advance for your help!!
    Last edited by Leith Ross; 07-31-2013 at 02:45 PM. Reason: Added Code Tags

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Macro to Copy and Paste a Column to the next available empty column
    By ekr in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-03-2013, 02:50 AM
  2. Replies: 5
    Last Post: 03-02-2013, 04:22 PM
  3. Cut/Paste to Empty Column Macro
    By xclnewb in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-22-2011, 12:55 AM
  4. Macro-Copy&Paste Fixed Data Ranges Into Last Empty Cell of Specific Column
    By hailnorm in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-26-2009, 10:15 PM
  5. Editting Macro to Select Last Empty Column to Paste Data
    By Zaraf in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 12-05-2008, 11:40 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