#1
|
|||
|
|||
How to open a form to a better place?
Here is a macro that opens a form which appears in the center of my computer screen.
Code:
Sub OpenHarvestForm() Application.WindowState = xlMinimized frmHarvest.Show Application.WindowState = xlMaximized ActiveWorkbook.Sheets("GrpRecords").Activate End Sub |
#2
|
|||
|
|||
http://http://www.vbaexpress.com/kb/....php?kb_id=382
http://stackoverflow.com/questions/2...tartupposition |
#3
|
|||
|
|||
Hi Logit,
Can't get through to your first link. The stack article is related but I cant write it into my code. I tried (shown here in green) but it never worked. Code:
Sub OpenHarvestForm() Application.WindowState = xlMinimized frmHarvest.Show Application.WindowState = xlMaximized Application.Right Application.Bottom ActiveWorkbook.Sheets("GrpRecords").Activate End Sub |
#4
|
|||
|
|||
I don't think that's the place to put it.
Here's what I did for my 1600x900 screen. In frmHarvest properties change StartUpPosition to 0 - Manual In the forms code module add Code:
Private Sub UserForm_Activate() Me.Top = Application.Height - frmHarvest.Height - 50 Me.Left = Application.Width - frmHarvest.Width - 40 End Sub |
#5
|
|||
|
|||
Code:
Private Sub UserForm_Initialize() Me.StartUpPosition = 0 Me.Top = Application.Top + Application.Height - Me.Height Me.Left = Application.Left + Application.Width - Me.Width End Sub |
#6
|
|||
|
|||
But UserForm_Initialize is used in the Submit button code as a reset of form textbox and combo values.
If the user has dragged the form to a different location they may not want it to relocate. |
#7
|
|||
|
|||
Not having much luck here.
It's OK. This was only a cosmetic thing anyway. I'll give it a miss. |
#8
|
|||
|
|||
Is this what you're after ?
|
#9
|
|||
|
|||
It looks good NS. but it creates a different issue. I had the sheet minimise but with the form remaining on top. But I dont want you to spend too much time on me being fussy. No doubt Ill have other questions more important.
Thanks. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
MS word 2007, capital letter after number (1. place turn to 1. Place) | enzo321 | Word | 1 | 10-23-2016 06:19 AM |
Paste from one page to another doesnt place in the same place | MrShhh | Visio | 0 | 09-21-2016 05:47 AM |
editing a number/text at one place and changes taking place wherever it appears | anurag.butoliya | Word | 1 | 06-14-2014 06:27 PM |
Creating Form, inserting text box - getting things to stay in place? | SHC | Word | 4 | 08-15-2013 09:18 AM |
when open doc formatting all over the place | Anne | Word | 1 | 11-30-2011 02:34 PM |