Results 1 to 19 of 19

Trying to find the right code to copy a column from one worksheet and paste to another

Threaded View

  1. #1
    Registered User
    Join Date
    11-15-2013
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    31

    Trying to find the right code to copy a column from one worksheet and paste to another

    Hi guys,

    I'm trying to create a button that essentially copies a column of data from one worksheet (prime) and pastes this column of data in another worksheet (secondary).

    However, I want to be able to keep pressing this button so that the newly pasted data in secondary is pasted into the next column. So whatever new inputs in the prime column will be copy pasted into a new column to the right of the previous copy paste. So far, I have this code below:

    The problem is it only copies and pastes to one column...

    Sub CollateProcurement()
        Dim NextRow As Long
        With Worksheets("Trend Analysis")
            iLastColumn = .Range("H7").End(xlToRight).Column
            Sheets("Procurement Pre Mobilisation").Range("I4").Copy .Range("H7")
            Sheets("Procurement Pre Mobilisation").Range("I5").Copy .Range("H8")
            Sheets("Procurement Pre Mobilisation").Range("I6").Copy .Range("H9")
            Sheets("Procurement Pre Mobilisation").Range("I7").Copy .Range("H10")
            Sheets("Procurement Pre Mobilisation").Range("I8").Copy .Range("H11")
            Sheets("Procurement Pre Mobilisation").Range("I9").Copy .Range("H12")
            Sheets("Procurement Pre Mobilisation").Range("I10").Copy .Range("H13")
            Sheets("Procurement Pre Mobilisation").Range("I11").Copy .Range("H14")
            Sheets("Procurement Pre Mobilisation").Range("I12").Copy .Range("H15")
            Sheets("Procurement Pre Mobilisation").Range("I13").Copy .Range("H15")
            Sheets("Procurement Pre Mobilisation").Range("I14").Copy .Range("H17")
            Sheets("Procurement Pre Mobilisation").Range("I15").Copy .Range("H18")
            Sheets("Procurement Pre Mobilisation").Range("I16").Copy .Range("H19")
            Sheets("Procurement Pre Mobilisation").Range("I17").Copy .Range("H20")
            Sheets("Procurement Pre Mobilisation").Range("I18").Copy .Range("H21")
            Sheets("Procurement Pre Mobilisation").Range("I19").Copy .Range("H22")
            Sheets("Procurement Pre Mobilisation").Range("I20").Copy .Range("H23")
            Sheets("Procurement Pre Mobilisation").Range("I21").Copy .Range("H24")
            Sheets("Procurement Pre Mobilisation").Range("I22").Copy .Range("H25")
        End with
    End Sub
    Any help would be greatly appreciated!

    Thanks guys.

    Kind regards,
    M
    Last edited by mw91; 11-15-2013 at 06:58 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Vba - find next empty column, insert column, copy paste values & copy paste formulas
    By DoodlesMama in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-20-2012, 12:43 PM
  2. Code: Find, Copy, Paste not working
    By ufopilot3 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-26-2012, 03:40 PM
  3. Help with find, copy, and paste code using offset
    By mundellj in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-28-2011, 08:16 PM
  4. code to find, copy and paste until find new, then repeat
    By siddharthariver in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-12-2010, 04:02 PM
  5. Find Value and Copy/Paste Row from One Worksheet to Another
    By GravityInvert in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-15-2008, 02:56 PM

Tags for this Thread

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