+ Reply to Thread
Results 1 to 4 of 4

Can total row height determine range for copy purposes?

  1. #1
    Registered User
    Join Date
    10-05-2011
    Location
    NYC
    MS-Off Ver
    Excel 2010 Professional Plus
    Posts
    44

    Can total row height determine range for copy purposes?

    Howdy All,

    In my attached sample file I have a pivot table with specific column widths but whose length and individual row height will fluctuate depending on the data set. In column F of the pivot tab, but outside of the pivot table, text will be manually added to various rows which, at times, causes the text to wrap and thus the row height adjusts accordingly. Once finished I manually copy half of the table to Leasing1 and the other half to Leasing2 (not part of macro), the split being determined by total row height.

    Upon completion, this file is made public. At this point other users make adjustments to the cells in column F of the pivot tab, which creates a difference in total row height between the two Leasing tabs.

    I'm looking for a macro that, once run, will:

    1. look at the total height of the pivot table
    2. divide that height by 2 (rounded to the nearest row)
    3. copy the first half of the roughly evenly split pivot table to Leasing1
    4. copy the remaining half of the pivot table to Leasing2


    Manually copying and formatting the two Leasing tabs after all adjustments have been made to pivot tab column F is not an option, unfortunately.

    This has had me stumped for a week. Many thanks in advance.
    Bjordion
    Attached Files Attached Files
    Last edited by Bjordion; 03-26-2013 at 09:54 AM. Reason: poor title

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Can total row height determine page break?

    Hi

    I have added a new macro to this called Split_Data to split your data over two pages.

    The macro has a subroutine Page_Setup that is only accessible via a macro.

    That Formats Both Output pages to fit on one or more sheets of Landscape A4. Complete with headers on each sheet
    [ So did you actually need to split the data? ]

    There is an option to clear your original data if you remove the ' before 'range("a1:h"& SR).formulaR1c1 = ""
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    10-05-2011
    Location
    NYC
    MS-Off Ver
    Excel 2010 Professional Plus
    Posts
    44

    Re: Can total row height determine page break?

    Thanks for the response. Unfortunately this is not doing what I need. I'd like the macro to look at the total row height of the pivot table, not the number of rows of the data set.

  4. #4
    Registered User
    Join Date
    10-05-2011
    Location
    NYC
    MS-Off Ver
    Excel 2010 Professional Plus
    Posts
    44

    Re: Can total row height determine range for copy purposes?

    I'm not sure if it will help, but I've determined that the total row height will always be a multiple of 15. I'm envisioning the macro setting rowheight as an integer, which is then divided by 2 and rounded to the nearest multiple of 15 to determine the range that is to be copied to the first sheet.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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