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

 

Advertisements

What is the syntax to access the right-most sheet?

Worksheets(Worksheets.Count)
'example
Worksheets(Worksheets.Count).Range("A1:A4") = "hello"
Worksheets(Worksheets.Count).Range("D1") = "world"
Worksheets(Worksheets.Count).Cells(2, 4).Value = "goodbye"

What is the syntax to split a string from the right?

Right(String, Length)
‘string – string to be searched; mandatory parameter
‘length – integer specifying the number of characters to be returned; mandatory parameter
'examples
Dim name As String
name = "Elon Gates"
MsgBox (Right(name, 5)) 'Gates
MsgBox (Right(name, 8)) 'on Gates
MsgBox (Right(name, 10)) 'Elon Gates