You are on page 1of 3

Dim stopped As Boolean

FULL SCREEN
Application.WindowState = xlMaximized
Me.Height = Application.Height
Me.Width = Application.Width
Me.Left = 0
Me.Top = 0

KELUAR
stopped = True
Unload Me

TITLE BAR (TEKS BERJALAN)


Dim Q As String, Cpt As String
Dim p As Long, n As Long

Q = "Kumpulan Tips UserForm Excel VBA"

n = Len(Q)
Cpt = Q
Awal:
DoEvents
jam = FormatDateTime(Time, vbLongTime)
If stopped = True Then Exit Sub
Me.Caption = Right(Cpt, n)
n=n+1
If n = (Len(Q) + 100) Then n = 0

For p = 1 To 8199966: Next


GoTo Awal

ZOOM
Private Sub SpinButton1_Change()
Me.text_Zoom.Value = Me.SpinButton1.Value
End Sub

Private Sub text_Zoom_Change()


Me.Zoom = Me.text_Zoom.Value
End Sub
ENABLE-DISABLE SHEET
Me.Hide

If Me.ToggleButton1.Value = True Then


Me.ToggleButton1.Caption = "Nonaktifkan Sheet"
Me.Show False
Else
Me.ToggleButton1.Caption = "Aktifkan Sheet"
Me.Show
End If

Private Sub UserForm_Activate()


Me.TextBox1.Value = "Nama"
Me.TextBox2.Value = "Alamat"
Me.TextBox3.Value = "Tempat Lahir"
Me.TextBox4.Value = "Tanggal Lahir"

TeksAnimasi
Me.SpinButton1.Value = 100
Me.text_Zoom.Value = 100
End Sub

DISABLE EXIT
Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
If CloseMode = 0 Then
Cancel = True
MsgBox "Gunakan tombol keluar bosku", vbCritical, "Information"
End If
End Sub
Private Sub TextBox1_Enter()
If Me.TextBox1.Value = "Nama" Then
Me.TextBox1.Value = " "
End If
End Sub
Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
If Me.TextBox1.Value = " " Then
Me.TextBox1.Value = "Nama"
End If
End Sub

WATERMARK
Private Sub TextBox2_Enter()
If Me.TextBox2.Value = "Alamat" Then
Me.TextBox2.Value = " "
End If
End Sub
Private Sub TextBox2_Exit(ByVal Cancel As MSForms.ReturnBoolean)
If Me.TextBox2.Value = " " Then
Me.TextBox2.Value = "Alamat"
End If
End Sub

Private Sub TextBox3_Enter()


If Me.TextBox3.Value = "Tempat Lahir" Then
Me.TextBox3.Value = " "
End If
End Sub
Private Sub TextBox3_Exit(ByVal Cancel As MSForms.ReturnBoolean)
If Me.TextBox3.Value = " " Then
Me.TextBox3.Value = "Tempat Lahir"
End If
End Sub

Private Sub TextBox4_Enter()


If Me.TextBox4.Value = "Tanggal Lahir" Then
Me.TextBox4.Value = " "
End If
End Sub
Private Sub TextBox4_Exit(ByVal Cancel As MSForms.ReturnBoolean)
If Me.TextBox4.Value = " " Then
Me.TextBox4.Value = "Tanggal Lahir"
End If
End Sub

You might also like