+ Reply to Thread
Results 1 to 8 of 8

VBA to copy and paste selected data between sheets

  1. #1
    Registered User
    Join Date
    12-14-2018
    Location
    Staffordshire, England
    MS-Off Ver
    365
    Posts
    60

    VBA to copy and paste selected data between sheets

    Hi All,

    Being new to VBA I am currently attempting to construct something that will transfer data from one sheet to another based on a particular date.

    So far I have managed to get as far as the below but I would like to be able to select only particular columns / cells from each row to copy from sheet 1 to sheet 2 as per my attached example. In addition I would also like to keep the formatting as a table which at the moment it also seems to disregard when copying to sheet 2 and commence the copy in column B rather than column A.

    Please Login or Register  to view this content.
    Many thanks for any assistance,
    Gaz
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor dotchiejack's Avatar
    Join Date
    05-21-2015
    Location
    Antwerp,Belgium
    MS-Off Ver
    2016
    Posts
    507

    Re: VBA to copy and paste selected data between sheets

    HI,
    Like this?
    Change the sheetnames with the real sheetnames.
    Please Login or Register  to view this content.
    Last edited by dotchiejack; 05-21-2019 at 09:26 AM.
    Click the * Add Reputation below to say thanks.

  3. #3
    Registered User
    Join Date
    12-14-2018
    Location
    Staffordshire, England
    MS-Off Ver
    365
    Posts
    60

    Re: VBA to copy and paste selected data between sheets

    Hi,

    Thanks but just a couple of further questions if you could assist.

    This code still commences the paste in column A where as I need it to start in column B so how can I change this? It also still copies and pastes the entire row rather than any selected columns only?

    Thanks,
    Gaz

  4. #4
    Valued Forum Contributor dotchiejack's Avatar
    Join Date
    05-21-2015
    Location
    Antwerp,Belgium
    MS-Off Ver
    2016
    Posts
    507

    Re: VBA to copy and paste selected data between sheets

    Second try.
    Like this?
    In your example columns I and J are not transfered and starting in column B
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    12-14-2018
    Location
    Staffordshire, England
    MS-Off Ver
    365
    Posts
    60

    Re: VBA to copy and paste selected data between sheets

    Thanks - that's perfect! :-)

  6. #6
    Valued Forum Contributor dotchiejack's Avatar
    Join Date
    05-21-2015
    Location
    Antwerp,Belgium
    MS-Off Ver
    2016
    Posts
    507

    Re: VBA to copy and paste selected data between sheets

    Glad to help and thanks for the rep.

  7. #7
    Registered User
    Join Date
    12-14-2018
    Location
    Staffordshire, England
    MS-Off Ver
    365
    Posts
    60

    Re: VBA to copy and paste selected data between sheets

    Sorry on e quick further question. If I wanted to add another parameter to the selection criteria - say something in cell B1 that was looking in column B, how could I do this?

    Thanks,

  8. #8
    Valued Forum Contributor dotchiejack's Avatar
    Join Date
    05-21-2015
    Location
    Antwerp,Belgium
    MS-Off Ver
    2016
    Posts
    507

    Re: VBA to copy and paste selected data between sheets

    Hi,
    Like this?
    Must meet both criteria.
    Please Login or Register  to view this content.
    Must meet 1 of the 2 criteria.
    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Prevent copy and paste data for selected cells
    By inoka in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 03-08-2018, 12:27 AM
  2. Copy data in Range and paste into selected column
    By goeman in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-18-2018, 03:47 PM
  3. Copy & Paste Data from Selected Worksheets to One Worksheet
    By wmetz1 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-19-2015, 09:11 PM
  4. Replies: 2
    Last Post: 05-06-2014, 08:26 AM
  5. Replies: 1
    Last Post: 03-15-2014, 05:44 AM
  6. copy data from selected cells , in selected row and paste it to ms word table ?
    By aaashaaa in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-06-2010, 03:25 PM
  7. Copy data from selected sheets to new sheet
    By nigelog in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-29-2008, 10:56 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