What is the syntax to open a userform?

<userform name>.Show
'example
frmHome.Show

 

Advertisements

What is the syntax to clear a listbox?

<listbox name>.Clear

'if clearing a userform's listbox from outside the userform
<userform name>.<listbox name>.Clear
'example
formHome.lstOutput.Clear

 

What is the syntax to open a userform in the top-right screen corner?

 Me.StartUpPosition = 0
 Me.Top = Application.Top + 25
 Me.Left = Application.Left + Application.Width - Me.Width - 25
'example - place in UserForm_Activate procedure
Private Sub UserForm_Activate() 'when form opens
   Me.StartUpPosition = 0
   Me.Top = Application.Top + 25
   Me.Left = Application.Left + Application.Width - Me.Width - 25
End Sub

 

Tips for User Interface Design [updating]

  1. Use simple dialog understandable by your target user (ie) no jargon
  2. Rely little on user memory (ex) lesser steps for user to memorize/follow
  3. Output meaningful error messages (ex) when error happens, tell them using normal english vs something like “error code 1035”
  4. Avoid limitless choices (ex) Give them a limit of choices as often as possible, vs an open text field that could produce all sorts of data mismatch errors
  5. Always have an exit (ie) never put user in a place where they cannot go back or get out
  6. Exploit consistency (ie) familiarity equates speedy learning
  7. Provide continuous feedback (ex) instead of just a loading bar, have a label underneath that tells the user what step the computer is on
  8. Purpose (not beauty) dictates design (ex) look at how ugly but popular sites like Reddit, Craigslist are