Arie Bos
Board Regular
- Joined
- Mar 25, 2016
- Messages
- 224
- Office Version
- 365
- Platform
- Windows
I'd like a label caption to dynamically update based on a value ('factor') selected with 5 option buttons (per hour/day/week/month/year)
the label in the last line shows the MCV value, but does not update with ' factor' when I click another option button.
the label in the last line shows the MCV value, but does not update with ' factor' when I click another option button.
VBA Code:
Private Sub Mat_TotCommercialValue()
Dim factor As Integer
Dim MCV As Long
Select Case True
Case OptHour: factor = Range("E_OperatingDays.Value") * Range("E_OperatingHours.Value") / 12
Case OptDay: factor = Range("E_OperatingDays.Value") / 12
Case OptWeek: factor = 52 / 12
Case OptMonth: factor = 1
Case OptYear: factor = 12
End Select
MCV = Val(txtCommercialValue.Value)
lblCommercialValue.Caption = Format(MCV / factor, "#,##0")
End Sub