+ Reply to Thread
Results 1 to 3 of 3

Set Window Size based on Cell Reference

  1. #1
    Forum Contributor
    Join Date
    11-21-2017
    Location
    USA
    MS-Off Ver
    2016
    Posts
    150

    Set Window Size based on Cell Reference

    Basically the code works something like this:

    - Click on cell H1
    - open a new window
    - resize the active window to the named range ("labor")
    - center active window to center of the screen

    The area I'm having problems with is resizing the active window to the range selected. While it is possible to manually adjust the width and height until it works, I'd like to be able to base this off cell references. It's easy enough to get the max column (c) and row (r) from the named range, but is it possible to set the window limits to not exceed c (width) and not exceed r (height) ?

    Please Login or Register  to view this content.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    08-17-2007
    Location
    Poland
    Posts
    2,543

    Re: Set Window Size based on Cell Reference

    These are not exact calculations, but closer to your needs.
    Please Login or Register  to view this content.
    Artik

  3. #3
    Forum Contributor
    Join Date
    11-21-2017
    Location
    USA
    MS-Off Ver
    2016
    Posts
    150

    Re: Set Window Size based on Cell Reference

    Thanks Artik! Works as expected. I modified it a little to better demonstrate the general concept of what I was after in the attached file for anyone interested.
    Attached Files Attached Files

+ 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. Is it possible to set window size on open and keep it that size
    By barman in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-29-2019, 01:19 AM
  2. [SOLVED] Control application window size based on resolution and dispaly specified rows and columns
    By dentler in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-18-2017, 09:26 PM
  3. [SOLVED] For step loop, need step size to change based on reference cell in row
    By Telperion in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-22-2013, 03:41 PM
  4. Limiting excel window size to match cell range?
    By jonvanwyk in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-23-2012, 04:05 PM
  5. Set window size with VBA.
    By c_leven3 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-01-2010, 03:15 PM
  6. How to set the size for the new window
    By lizaro in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-04-2008, 07:42 AM
  7. Format cell window size
    By KHall1968 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-13-2005, 07:05 AM

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