Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Window Resize

Ryan,

A simple record of a macro produced the following code:
see if this helps...

''''''''''''''''
Application.WindowState = xlNormal
Application.Left = 155.5
Application.Top = 35.5
Application.Width = 700
Application.Height = 500
'''''''''''''''''''''''''''''''''''''''

--
steveb
(Remove 'NOSPAM' from email address if replying direct)


"Ryan" wrote in message
...
I have a command button in a spreadsheet that opens up another

spreadsheet. I want to know how I can set it so that when the second
spreadsheet opens, I can set the size of the window it is in, or at least
have it not maximized or minimized.

Ryan



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Window Resize

Ryan,

Excel is funny this way. Either/Or.

So I recorded (and modified) another macro and reduced one workbook and
enlarged the second to fit the screen....
There are ways to have the code identify the windows with variables.

''''''''''''''''
With Windows("Book1.xls")
.Top = 1
.Left = 5
End With
With Windows("Book1.xls")
.Width = 691.5
.Height = 432
End With
With Windows("Book2.xls")
.Top = 100
.Left = 50
End With
With Windows("Book2.xls")
.Width = 200
.Height = 100
End With
'''''''''''''''''''''''''''

--
steveb
(Remove 'NOSPAM' from email address if replying direct)


"Ryan" wrote in message
...
Steve,

The code that you gave me works almost perfectly. The one problem is that

it resizes the original workbook too. I want it so that Excel stays
maximized but the new workbook is smaller. I will play around with it some
and see if I can figure it out, but if anyone knows how to fix this problem
please post.

Ryan



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default Window Resize

In place of "Application" use "ActiveWindow".

--
Jim Rech
Excel MVP
"Ryan" wrote in message
...
| Steve,
|
| The code that you gave me works almost perfectly. The one problem is that
it resizes the original workbook too. I want it so that Excel stays
maximized but the new workbook is smaller. I will play around with it some
and see if I can figure it out, but if anyone knows how to fix this problem
please post.
|
| Ryan


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cannot Resize Workbook window Nightmry Excel Discussion (Misc queries) 4 May 12th 23 03:44 AM
How to resize Data Form dialog window? Compucat Excel Worksheet Functions 1 June 8th 05 11:24 PM
Need to resize a worksheet window Hasta Pasta Excel Discussion (Misc queries) 5 January 8th 05 10:49 PM
Resize the workbook window is impossible Valeria Excel Discussion (Misc queries) 1 December 29th 04 11:30 AM
Window Resize Jim Rech Excel Programming 1 May 13th 04 06:18 PM


All times are GMT +1. The time now is 02:07 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"