Results 1 to 2 of 2

Automatic window sizing

Threaded View

wmorrison49 Automatic window sizing 10-23-2008, 08:28 AM
wmorrison49 I just found my answer. This... 10-23-2008, 09:17 AM
  1. #1
    Forum Contributor wmorrison49's Avatar
    Join Date
    09-25-2007
    Posts
    267

    Automatic window sizing

    Hello,
    I am trying to have a window autosize upon opening, everything from A1 to O34. I find the following code which I have tried to adjust but I don't know enough about these functions to make it work for me. This was for a version of Monopoly in Excel:

    Sub ZoomToFit()
    
        ThisWorkbook.Sheets("Board").Range("a1").Activate
        On Error GoTo errtrap
        With ActiveWindow
            'zoom out
            Do While Not Intersect(.VisibleRange.Cells, Range("corner_cell").Cells) Is Nothing
                .Zoom = .Zoom + 5
            Loop
            'zoom in
            Do While Intersect(.VisibleRange.Cells, Range("corner_cell").Cells) Is Nothing
                .Zoom = .Zoom - 5
            Loop
        End With
        Exit Sub
    errtrap:
        ActiveWindow.Zoom = 75
    End Sub
    If anybody has a simple way to do this for A1:O34 that would really help me out a lot. Thanks for your help guys.

    Will
    Last edited by wmorrison49; 10-23-2008 at 09:17 AM.

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