Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Resizing user form in excell

I have created a form. The form is quite large - 60 fields to fill in
(The customer wanted it that way). The form is larger than the screen
were the resolution is low on the monitor. I can have the customer
adjust the resolution and then the whole form will show up on the
screen.
I was wondering if a scroll bar can be added so the customer can move
to the lower half of the form. How do I add it in?

I tried changing the form properties but that would not allow the form
to be moved or resized.

Any ideas would be greatly appreciated.

Thank you,


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Resizing user form in excell

Thank you that works for scrolling. Do you have the formula for
resizing the form to screen be proportioned to the veiwable screen?

Lmnorms1

Die_Another_Day wrote:
You also need to set the scroll height property. this can be done on
the fly like so:

userform1.scrollheight = 12321 'Random number
or if you know the farthest control down...
userform1.scrollheight = CommandButton1.Top + CommandButton1.Height

HTH

Die_Another_Day
wrote:
Hello,
I am sorry to report this had no effect.

I would be willing to try another idea.

Thank you,
lmnorms1


Die_Another_Day wrote:
click on the userform in the vba editor, then view properties. change
the "Scrollbars" properties as desired.

HTH

Die_Another_Day
wrote:
I have created a form. The form is quite large - 60 fields to fill in
(The customer wanted it that way). The form is larger than the screen
were the resolution is low on the monitor. I can have the customer
adjust the resolution and then the whole form will show up on the
screen.
I was wondering if a scroll bar can be added so the customer can move
to the lower half of the form. How do I add it in?

I tried changing the form properties but that would not allow the form
to be moved or resized.

Any ideas would be greatly appreciated.

Thank you,




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 644
Default Resizing user form in excell

Give this a try.
Option Explicit

Private Const SPI_GETWORKAREA = 48

Private Declare Function SystemParametersInfo Lib "user32" _
Alias "SystemParametersInfoA" (ByVal uAction As Long, _
ByVal uParam As Long, ByRef lpvParam As Any, _
ByVal fuWinIni As Long) As Long

Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type

Sub SizeForm()
Dim nRect As RECT

SystemParametersInfo SPI_GETWORKAREA, 0, nRect, 0
With UserForm1
.Top = nRect.Top
.Left = nRect.Left
.Width = (nRect.Right - nRect.Left) * 0.75
.Height = (nRect.Bottom - nRect.Top) * 0.75
End With
UserForm1.Show

End Sub

HTH

Die_Another_Day

P.S. Can someone explain to me why I have to multiply my height and
width by .75 to get it to work properly?

wrote:
Thank you that works for scrolling. Do you have the formula for
resizing the form to screen be proportioned to the veiwable screen?

Lmnorms1

Die_Another_Day wrote:
You also need to set the scroll height property. this can be done on
the fly like so:

userform1.scrollheight = 12321 'Random number
or if you know the farthest control down...
userform1.scrollheight = CommandButton1.Top + CommandButton1.Height

HTH

Die_Another_Day
wrote:
Hello,
I am sorry to report this had no effect.

I would be willing to try another idea.

Thank you,
lmnorms1


Die_Another_Day wrote:
click on the userform in the vba editor, then view properties. change
the "Scrollbars" properties as desired.

HTH

Die_Another_Day
wrote:
I have created a form. The form is quite large - 60 fields to fill in
(The customer wanted it that way). The form is larger than the screen
were the resolution is low on the monitor. I can have the customer
adjust the resolution and then the whole form will show up on the
screen.
I was wondering if a scroll bar can be added so the customer can move
to the lower half of the form. How do I add it in?

I tried changing the form properties but that would not allow the form
to be moved or resized.

Any ideas would be greatly appreciated.

Thank you,


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Resizing user form in excell

Thank you,
That works very nicely.

I very much appreciate it.

lmnorms1
Let me know if I can ever help you.


Die_Another_Day wrote:
Give this a try.
Option Explicit

Private Const SPI_GETWORKAREA = 48

Private Declare Function SystemParametersInfo Lib "user32" _
Alias "SystemParametersInfoA" (ByVal uAction As Long, _
ByVal uParam As Long, ByRef lpvParam As Any, _
ByVal fuWinIni As Long) As Long

Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type

Sub SizeForm()
Dim nRect As RECT

SystemParametersInfo SPI_GETWORKAREA, 0, nRect, 0
With UserForm1
.Top = nRect.Top
.Left = nRect.Left
.Width = (nRect.Right - nRect.Left) * 0.75
.Height = (nRect.Bottom - nRect.Top) * 0.75
End With
UserForm1.Show

End Sub

HTH

Die_Another_Day

P.S. Can someone explain to me why I have to multiply my height and
width by .75 to get it to work properly?

wrote:
Thank you that works for scrolling. Do you have the formula for
resizing the form to screen be proportioned to the veiwable screen?

Lmnorms1

Die_Another_Day wrote:
You also need to set the scroll height property. this can be done on
the fly like so:

userform1.scrollheight = 12321 'Random number
or if you know the farthest control down...
userform1.scrollheight = CommandButton1.Top + CommandButton1.Height

HTH

Die_Another_Day
wrote:
Hello,
I am sorry to report this had no effect.

I would be willing to try another idea.

Thank you,
lmnorms1


Die_Another_Day wrote:
click on the userform in the vba editor, then view properties. change
the "Scrollbars" properties as desired.

HTH

Die_Another_Day
wrote:
I have created a form. The form is quite large - 60 fields to fill in
(The customer wanted it that way). The form is larger than the screen
were the resolution is low on the monitor. I can have the customer
adjust the resolution and then the whole form will show up on the
screen.
I was wondering if a scroll bar can be added so the customer can move
to the lower half of the form. How do I add it in?

I tried changing the form properties but that would not allow the form
to be moved or resized.

Any ideas would be greatly appreciated.

Thank you,


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
resizing calendar in excell 2003. bob_bubba Excel Discussion (Misc queries) 2 July 16th 09 07:00 PM
Can i use lines in a user form in excell jparker9 Excel Programming 2 January 13th 06 03:01 PM
How to: User Form to assign a user defined range to a macro variab TrevTrav Excel Programming 1 March 22nd 05 07:57 PM
Resizing list boxes in a form Alan[_22_] Excel Programming 0 February 24th 04 06:21 PM
resizing an image on a form Liam[_2_] Excel Programming 1 November 14th 03 10:06 PM


All times are GMT +1. The time now is 06:32 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"