+ Reply to Thread
Results 1 to 6 of 6

Cut and Paste Last Fourteen Rows

  1. #1
    Forum Contributor
    Join Date
    09-19-2004
    Location
    Canada
    Posts
    408

    Cut and Paste Last Fourteen Rows

    Hi all,

    I have several similarly formatted daily reports with a detailed upper section and a 14-row summary lower section. Currently, I have to manually format them to print on letter size paper - which is very time consuming.

    I need to cut and paste the summary section to a new sheet, and then repeat the Row 4 column header on all the pages for the detailed section. (I think I would be able to add the column widths and other formats.)

    Can someone please help me with some codes.

    Thank you very much,
    Gos-C
    Last edited by Gos-C; 11-17-2010 at 06:33 AM.
    Using Excel 2010 & Windows 10
    "It is better to be prepared for an opportunity and not have one than to have an opportunity and not be prepared."

  2. #2
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Cut and Paste Last Fourteen Rows

    This might give you a start.
    Please Login or Register  to view this content.
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

  3. #3
    Forum Contributor
    Join Date
    09-19-2004
    Location
    Canada
    Posts
    408

    Re: Cut and Paste Last Fourteen Rows

    Hi Marcol,

    Very good start! Thank you.

    To clarify, the headers are in row 4 and are for the detailed section if it cannot fit on one pages. So, I need the code to add the headers on any subsequent page (currently, those pages do not show the headers).

    Sheet2 does not exist - the reports come with just one sheet.

    Also, is my substitution to find the last row a safer bet?

    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    09-19-2004
    Location
    Canada
    Posts
    408

    Re: Cut and Paste Last Fourteen Rows

    Hi all,

    Together with Marcol's code and another one that I found
    HTML Code: 
    , here is my solution:

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.

    It works perfectly!

    Thank you, Marcol.

    Regards,
    Gos-C
    Last edited by Gos-C; 11-17-2010 at 06:32 AM.

  5. #5
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Cut and Paste Last Fourteen Rows

    I would use the code I gave you for LastRow
    Please Login or Register  to view this content.
    Change the column letter, as required,to a known column that will always have data for the last required row.
    This is more controllable than using the Find method, that finds the last used row in the sheet.

    Let's say that we know that column "A" will always contain the last row of relevant data and there are no more irrelevant entries in that column, and for example that row is 20.

    If there is unrequired data in say Range("C25"), let's say a footnote you don't need to copy,or indeed seems to be empty but actually has a string of spaces ,
    Please Login or Register  to view this content.
    will return 20
    Please Login or Register  to view this content.
    will return 25

  6. #6
    Forum Contributor
    Join Date
    09-19-2004
    Location
    Canada
    Posts
    408

    Re: Cut and Paste Last Fourteen Rows

    Valid point! I will do that. Thank you, Marcol.

    Gos-C

+ 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