Trueblue862
Board Regular
- Joined
- May 24, 2020
- Messages
- 160
- Office Version
- 365
- Platform
- Windows
Hi, I'm currently learning VBA, I've created this piece of code below. I'm looking for advice on ways to improve it. This is the first piece of code that I've written entirely without copying or modifying sections from someone else. This code works perfectly for my purposes, I'm just looking for advice on how to go about making it better for future reference. I appreciate any input on this.
VBA Code:
Private Sub LabEL_upDate()
If tbxSloppy.Value = "" And tbxJade.Value = "" Then
LabelE.Visible = True
LabelE.Caption = "YES!!!"
LabelE.BackColor = vbGreen
Else
LabelE.Visible = False
End If
labeL_DaTe
End Sub
Private Sub labeL_DaTe()
If LabelE.Visible = True Then Exit Sub
If tbxSloppy.Value = "PERHAPS" And tbxJade.Value = "" Then
LabelE.Visible = True
LabelE.Caption = "MAYBE"
LabelE.BackColor = vbYellow
Else
LabelE.Visible = False
End If
labeL_DaTe2
End Sub
Private Sub labeL_DaTe2()
If LabelE.Visible = True Then Exit Sub
If tbxSloppy.Value <> "" Or tbxJade.Value <> "" Then
LabelE.Visible = True
LabelE.Caption = "NO :( "
LabelE.BackColor = vbRed
Else
LabelE.Visible = False
End If
End Sub