+ Reply to Thread
Results 1 to 2 of 2

Control application window size based on resolution and dispaly specified rows and columns

  1. #1
    Forum Contributor
    Join Date
    01-08-2017
    Location
    Salt Lake City, Ut.
    MS-Off Ver
    2019 and 365
    Posts
    143

    Question Control application window size based on resolution and dispaly specified rows and columns

    I have created an excel workbook application that works fine on my workstation but when I install it on say a 13 inch laptop, the windows is too big and I have difficulty accessing the tabs at the bottom. I am trying to resolve two problems.

    Problem 1: I have an excel workbook that I want to open to a size based on the screen size/resolution of the system it opens on.

    Problem 2: My excel sheets uses a range from A1 through O46, and I want them to fill this application window to autosize the number of rows to fit the size from Problem 1 above. I can use autofit for the number of rows, but that is not possible with the columns since each columns may serve a different purpose and required a different character width depending on its use and format. I can not specify a specific row height since this variable may be dependent on the application window size from problem 1 above.

    Does anyone have any ideas or suggestions for resolving these two problems?

    Thanks in advance for any suggestions.

  2. #2
    Forum Contributor
    Join Date
    01-08-2017
    Location
    Salt Lake City, Ut.
    MS-Off Ver
    2019 and 365
    Posts
    143

    Re: Control application window size based on resolution and dispaly specified rows and col

    I posted this on the 14th and did not get any replies. After much searching on the internet, I found a solution that works really well and does not required the code to find the screen resolution of the system it is running on. Part of the solution can be found at the following link: " https://excelribbon.tips.net/T010091..._and_Size.html " I placed the following two routines into my code:

    Please Login or Register  to view this content.
    Although the link suggest placing the following code in the Workbook_Open sub-routine, it did not work, so I placed it in

    Please Login or Register  to view this content.
    I then placed in another module the following code:

    Please Login or Register  to view this content.
    then a call to it in:

    Please Login or Register  to view this content.
    The overall effect is that if the user adjust the size of the screen manually or with the minimize of maximum window settings, the range I selected automatically adjust within the new window size. Once they have made their adjustments and close the program while saving, the settings are Saved with the Workbook_BeforeClose Sub. When they reopen it will return to that size with the Workbook_WindowActivate sub.

    it works really well and I will no doubt use this in all my other programming.

    I almost forgot to mention for each worksheet you want to resize:
    "
    Private Sub Worksheet_Activate()
    AdjustScreen
    End Sub"
    Last edited by dentler; 09-18-2017 at 10:16 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. listbox size is auto change when open by different resolution
    By ccs1981 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-23-2015, 11:15 PM
  2. Application.Width = 75% of Stated Screen Resolution. What is causing this?
    By SymphonyTomorrow in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-30-2014, 01:38 PM
  3. VBA FileSystemObject Properties: Dimensions, Size and Vertical resolution
    By ferguson in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-13-2013, 12:48 PM
  4. [SOLVED] Macro to Compare Columns A & B and dispaly any duplicates in Columns C & D
    By robertguy in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-12-2013, 02:24 AM
  5. call macro when application window size changes
    By mkalenuik in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-17-2011, 12:52 PM
  6. [SOLVED] Option Button on sheet changes size in 1024 by 768 resolution
    By Michael Tress in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-13-2006, 05:10 PM
  7. [SOLVED] Dynamic cell address resolution in visual basic application?
    By John Carter in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-26-2006, 11:50 AM

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