+ Reply to Thread
Results 1 to 6 of 6

Data range copy and paste

  1. #1
    Registered User
    Join Date
    06-10-2021
    Location
    Brisbane, Australia
    MS-Off Ver
    2016
    Posts
    19

    Data range copy and paste

    Hi All,

    I have a worksheet called "Historical" which has data in a range A2:G1256. This range may not all have data every time.

    I wish to copy the last 62 rows of whatever rows have been populated. Then the data needs to be copied and pasted into another worksheet called "Charts" in the range (AE3:AK65)

    Would prefer a formula instead of a macro if it can be done.

    Thanks in advanced.

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,986

    Re: Data range copy and paste

    There's a fair bit of information missing here. For example, are the values text or numbers? Are they raw data or the results of formulae?

    This works for text and numbers, im my version of Excel. Change the 5 to a 62 for 62 rows...

    =INDEX(Sheet1!A:A,AGGREGATE(14,6,MATCH({1E+100,"Zzzz"},Sheet1!A:A),1)-5):INDEX(Sheet1!A:A,AGGREGATE(14,6,MATCH({1E+100,"Zzzz"},Sheet1!A:A),1))

    You seem to be using an older version of Excel than me. So, please refer to the attached file. If the formulae are enclosed within a pair of { }, these are array formulae.

    These are a little different from ordinary formulae in that they MUST be confirmed in the FIRST CELL ONLY by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. After that, the array can be dragged down as normal, to cover the desired range.

    You will know the array is active when you see the curly brackets { } appear around the outside of your formula. If you do not use CTRL+SHIFT+ENTER you will (almost always) get an error message or an incorrect answer. Press F2 on that cell and try again.

    Don't type the curly brackets yourself - it won't work...
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  3. #3
    Registered User
    Join Date
    06-10-2021
    Location
    Brisbane, Australia
    MS-Off Ver
    2016
    Posts
    19

    Re: Data range copy and paste

    I am finding it is only copying the 62nd row only and not the LAST 62 rows.

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,986

    Re: Data range copy and paste

    Excel version incompatability!! *&@#~ it!!

    Try this:

    =INDEX(Sheet1!A:A,AGGREGATE(14,6,MATCH({1E+100,"Zzzz"},Sheet1!A:A),1)-5+ROWS(A$2:A2)-1)

    Change the 5 to 62 and copy down 62 rows.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    06-10-2021
    Location
    Brisbane, Australia
    MS-Off Ver
    2016
    Posts
    19

    Re: Data range copy and paste

    that worked a treat. Many thanks.

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,986

    Re: Data range copy and paste

    You're welcome.



    It would be very nice if you were to just click the Add Reputation button at the foot of any of the posts of members who helped you reach a solution.

    Finally, if that takes care of your original question, please select "Thread Tools" from the menu link above and mark this thread as SOLVED.

+ 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. Copy and paste range that contains data & copy and paste, if cell contains data
    By Butcher1 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-29-2020, 01:48 AM
  2. [SOLVED] copy range and paste next to each cell with data
    By maym in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-10-2016, 02:13 AM
  3. Copy and Paste cells from Range with data
    By rikk1965 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-04-2014, 05:50 AM
  4. [SOLVED] Copy Data from one sheet and paste the consolidated data into another (Data Range Varies)
    By kittu55 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-13-2013, 10:02 PM
  5. Copy/Paste range of data excluding certain rows and copy to another workbook
    By HoerbigAdm in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-12-2012, 02:51 PM
  6. How to copy/paste range only if data in ANY cell of that range
    By bridie4 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-22-2011, 08:13 AM
  7. Copy a range of data and paste to the last row of another workbook
    By BananaTang in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-19-2008, 09:02 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