View Single Post
 
Old 04-30-2020, 07:41 PM
Guessed's Avatar
Guessed Guessed is offline Windows 10 Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,176
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

Marc

I'm not sure what you mean by 'save those values to the userform'. Just by moving the control on the userform when editing the layout you are effectively saving those values.

You can use the GUI to reposition any control on the userform (assuming you can select it). You can also use a macro such as the following to position the form itself or move a control to a particular position on the form. Because of its name, this macro will autorun when the form is loading so the form will open showing your control in its rightful position.

Code:
Private Sub UserForm_Initialize()
  With Me
    .StartUpPosition = 0
    .Left = Application.Left + 0.5 * (Application.Width - .Width)
    .Top = Application.Top + 0.5 * (Application.Height - .Height)
    .txHyperlinkzName.Top = 134
    .txHyperlinkzName.Left = 24
    .txHyperlinkzName.BackColor = &HC000&
  End With
End Sub
I use this code generically on all of my userforms (apart from your control named lines) to always position my userform in the middle of the application window. This saves lots of angst when using multiple screens.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote