+ Reply to Thread
Results 1 to 7 of 7

Copy 3 columns and paste with varying row offsets

  1. #1
    Forum Contributor
    Join Date
    02-01-2008
    Location
    Perth, Australia
    MS-Off Ver
    Excel 365
    Posts
    135

    Question Copy 3 columns and paste with varying row offsets

    Hi All,

    I am trying to copy three columns of information from sheet1 into sheet2.
    When pasted I need the information to be spaced or offset as per below sample.
    Please help.

    Sheet1
    HTML Code: 
    Sheet2
    HTML Code: 
    Any help is appreciated.

    Thanks
    Last edited by Zimbo; 03-31-2009 at 09:33 PM.

  2. #2
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Copy 3 columns and paste with varying row offsets

    Hi, This works for your Data.
    Please Login or Register  to view this content.
    Regards Mick

  3. #3
    Forum Contributor
    Join Date
    02-01-2008
    Location
    Perth, Australia
    MS-Off Ver
    Excel 365
    Posts
    135

    Re: Copy 3 columns and paste with varying row offsets

    Hi MickG,

    Thanks for the code it works quite well.
    Would it be possible to make a few changes?
    1. Can the code copy only the visible range
    2. Can the numbers be sequential only when there is an "Animal" in the cell to the right, currently it is numbering all including when there are spaces.

    Thanks again

  4. #4
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Copy 3 columns and paste with varying row offsets

    Hi, Do you mean that column "A" which showed a list of Numbers was infact the Row Ref, and Column "A" should have been the next column Shown as Column (B), which should have been the starting point.
    also,what do you mean by visible Range.
    How many columns do you want to be included in your Data.
    Mick

  5. #5
    Forum Contributor
    Join Date
    02-01-2008
    Location
    Perth, Australia
    MS-Off Ver
    Excel 365
    Posts
    135

    Re: Copy 3 columns and paste with varying row offsets

    Hi Mick,

    Yes column "A" was the Row Ref, and Column "A" should have been the next column Shown as Column (B), which should have been the starting point.
    What I meant by visible Range is if I hide any Rows they will not be copied or pasted.
    I only need 3 columns but may need to add one or two at a later stage, is this something that could be a variable.

    Sorry I hadn't been more specific initially.

    Thanks

  6. #6
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Copy 3 columns and paste with varying row offsets

    Hi, give this a try:- It should take care of extra columns (by you physically)altering the Variable "col" at top of code to suit and it should now only show the Rows that aren't Hidden.
    Please Login or Register  to view this content.
    Regards Mck

  7. #7
    Forum Contributor
    Join Date
    02-01-2008
    Location
    Perth, Australia
    MS-Off Ver
    Excel 365
    Posts
    135

    Smile Re: Copy 3 columns and paste with varying row offsets

    Hi Mick,

    Your code works perfectly.

    Thanks for your time.

    Cheers

+ 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