Worksheet Auto Sizing

  • Hi there!


    I hope that this problem has not been covered in the past but I could not find exactly what I need to do. First of all, I have a multi-sheet workbook used by other employees all with different resolutions on their monitors. I want each sheet of my workbook to open with the entire width of data viewed. Unfortunately, each sheet varies in width. I have set a scroll area for each sheet so I am not concerned about them scrolling beyond the data. I have tried setting a pixle width for each sheet but this just doesn't work with different resolutions. I am wondering if there is some way to have the area viewed in relation to a cell range? I have been looking but so far nada! With the present method, it is necessary to resize each sheet to be able to see all the data which is not a good thing.


    Thanks so much for your help! :)

    Thanks,


    Blue

  • Re: Worksheet Auto Sizing


    In the Private Module for each sheet you want to autosize, add the following macro.

    Code
    Private Sub Worksheet_Activate()
        Range("A1:M3").Select
        ActiveWindow.Zoom = True
        Range("A1").Select
    End Sub


    Adjust the range WIDTH to match the sheet's needs. (If you care only about column fitting the screen, make sure that your range does not have too many rows so that this dimension becomes the limitied sizing parameter.)


    To get to the sheet Private Module, while on the sheet RIGHT CLICK the sheet's tab and select VIEW CODE.

  • Re: Worksheet Auto Sizing


    Thanks, Thomas


    I have tried your method and while it does help the situation, the width of the application window still needs to be adjusted. Is there a way around this?


    Your help is much appreciated!

    Thanks,


    Blue

  • Re: Worksheet Auto Sizing


    I'm afraid I do not understand your question. Each sheet should have it's own macro individually tailored to the columns that need to be "sized to fit." What do you mean by "Application Window?"

  • Re: Worksheet Auto Sizing


    Thanks for the help. I did have the code individually assigned to each sheet but I was attempting to get all the data into the window instead of limiting the number of rows which I have now done. Works just great!

    Thanks,


    Blue

Participate now!

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