+ Reply to Thread
Results 1 to 5 of 5

Set window size with VBA.

  1. #1
    Registered User
    Join Date
    01-20-2010
    Location
    Atlanta, GA
    MS-Off Ver
    Excel 2007
    Posts
    18

    Set window size with VBA.

    Hey guys,

    I'm looking for a way to use VBA to set the window size upon opening the workbook. When the document opens, there should be two windows, each taking up half the screen and each on a particular tab.

    Currently, if I save the workbook with the window settings I want, when I open it, both windows are maximized. When I hit the restore button, they go back the settings with which they were saved, which is what I want it to look like as soon as it's opened.

    Also, a bonus would be for the code to determine the screen size, so it can fill the screen no matter what monitor/computer it's opened on.

    Thanks,
    Kyle
    Last edited by c_leven3; 02-01-2010 at 03:17 PM.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Set window size with VBA.

    Assuming the correct windows are open,
    Please Login or Register  to view this content.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    12-27-2009
    Location
    Paris, France
    MS-Off Ver
    Excel 2003
    Posts
    64

    Re: Set window size with VBA.

    Hello,

    Copy the following code in ThisWorkbook

    Please Login or Register  to view this content.
    Copy the following code in standard module

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

    PMO
    Patrick Morange

  4. #4
    Registered User
    Join Date
    01-20-2010
    Location
    Atlanta, GA
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: Set window size with VBA.

    Thanks to both of you. Here's what I ended up doing:

    InThisWorkbook:
    Please Login or Register  to view this content.
    How do I mark the thread as solved? I'm new around here.
    Last edited by c_leven3; 02-01-2010 at 03:10 PM. Reason: Added my code.

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Set window size with VBA.

    How do I mark the thread as solved?
    See the Forum Rules

+ 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