Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 88
Default Screen Width & Height

How can I increase the size of the form to the screen size.

I used the following but this produced an error. Variable Not defined


Sub Userform Initialize()
with Userform1
.Width=Screen.Width
.Height=Screen.Height
End With
End Sub

How can I increase the size of the userform to the screen size as this form
will be used on multiple screens of different sizes.

Regards
Lee
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 88
Default Screen Width & Height

Solved it by writing a few functions

Public Declare Function GetSystemMetrics Lib "User32" _
(ByVal nlndex As Long) As Long

Public Const SM_CXSCREEN = 0
Public Const SM_CYSCREEN = 1

Public Function ScreenHeight() As Long

ScreenHeight = GetSystemMetrics(SM_CYSCREEN)

End Function
Public Function ScreenWidth() As Long

ScreenWidth = GetSystemMetrics(SM_CXSCREEN)

End Function

Thanks anyway to anyone who tried to assist


"leerem" wrote:

How can I increase the size of the form to the screen size.

I used the following but this produced an error. Variable Not defined


Sub Userform Initialize()
with Userform1
.Width=Screen.Width
.Height=Screen.Height
End With
End Sub

How can I increase the size of the userform to the screen size as this form
will be used on multiple screens of different sizes.

Regards
Lee

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
Row height/column width Connie Martin Excel Discussion (Misc queries) 3 June 20th 09 04:12 PM
Screen. Width Screen.height leerem Excel Discussion (Misc queries) 1 May 22nd 09 01:57 PM
cell width and height Brian Brandt New Users to Excel 3 February 14th 06 10:57 AM
Column Width and Row Height Pillow Excel Worksheet Functions 0 December 13th 05 03:58 PM
Height/Width measurements MrBill Excel Worksheet Functions 3 May 18th 05 11:23 PM


All times are GMT +1. The time now is 03:05 PM.

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"