Copy page margins from one workbook to another

  • Re: Copy page margins from one workbook to another


    You could set up a template sheet in Master.xlsm with no data set up how you want - then copy this to Numbers.xlsm, delete sheet1 in Numbers.xlsm and rename the copied sheet to sheet1 - this could be done via VBA - the Page Object has an enormous amount of properties (try recording a macro and you will see what I mean) - I think this would be the easiest way. There are some macros/add ins around that may be looking for what you want. What specifically do you want to replicate wrt page margins?

    Regards
    [SIZE=3]Anthony
    [/SIZE]&WCF_AMPERSAND[SIZE=3]
    [/SIZE]&WCF_AMPERSAND&WCF_AMPERSAND&WCF_AMPERSAND[SIZE=2]You have your way. I have my way. As for the right way, the correct way, and the only way, it does not exist.[/SIZE]




  • Re: Copy page margins from one workbook to another


    Code
    Sub M_snb()
        With Workbooks("Numbers.xlsm").Sheet1.PageSetup
             .TopMargin = Workbooks("Master.xlsm").Sheet1.PageSetup.TopMargin
             .BottomMargin = Workbooks("Master.xlsm").Sheet1.PageSetup.BottomMargin
             .LeftMargin = Workbooks("Master.xlsm").Sheet1.PageSetup.LeftMargin
             .RightMargin = Workbooks("Master.xlsm").Sheet1.PageSetup.RightMargin
        End With
    End Sub
  • Re: Copy page margins from one workbook to another


    I have a folder on my flashdrive "H" called, "H:\140202-NumberTemplate
    In this folder there are 2 workbooks
    1)"NumberMaster.xlsm"
    2)"Number.xlsm"



    Run-time error "438":
    Object doesn't support property or method

  • Re: Copy page margins from one workbook to another


    Please use code tags when posting code to the forum - please read our forum rules http://www.ozgrid.com/forum/announcement.php?f=8 - Forum Rule 1



    I have added them for you this time however please make sure that you include code tags in all your subsequent posts.

    Regards
    [SIZE=3]Anthony
    [/SIZE]&WCF_AMPERSAND[SIZE=3]
    [/SIZE]&WCF_AMPERSAND&WCF_AMPERSAND&WCF_AMPERSAND[SIZE=2]You have your way. I have my way. As for the right way, the correct way, and the only way, it does not exist.[/SIZE]




  • Re: Copy page margins from one workbook to another


    In my last reply I said 1)"Numbermaster.xlsm" instead of "Master.xlsm". I think this take me back to your original sugestion.
    My Masterfile has different databasis and I use a userform to enter and calculate values. Each application like "Numbers.xlsm" retain only data as calculated in "Master.xlsm". To succeed I need the following information to transfer 1)Page orientation 2)Page margins 3)Row height 4) the first 15 column widths in "Master.xlsm". Except for page margins VB can set the rest by obtaining the values as recorded in cells on "Master.xlsm" I dont no of a way that page margins can be set to a cell value. I've got both workbooks open when I try your macros but errors range from 438 to 9. Can you make me a dummy setup
    Regards

  • Re: Copy page margins from one workbook to another


    As I stated before I am new to this forum and do not know all the rules a regulations but will apply it if I know what it was
    Regards

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!