Hello all,
I am trying to get two text boxes on a userform to populate a third box on the form when the user inputs the data in both of the first two boxes. I am pretty sure i need to use a change event, but I am not sure how or what triggers them. so I have:
Private Sub VSShortPrem_Change(ByVal Target As Range)
If Me.VSShortPrem.Value = "" Then Exit Sub
If Me.VSLongPrem.Value = "" Then Exit Sub
Me.VSNetPrem.Value = CDbl(Me.VSShortPrem.Value) - CDbl(Me.VSLongPrem.Value)
End Sub
Private Sub VSLongPrem_Change(ByVal Target As Range)
If Me.VSShortPrem.Value = "" Then Exit Sub
If Me.VSLongPrem.Value = "" Then Exit Sub
Me.VSNetPrem.Value = CDbl(Me.VSShortPrem.Value) - CDbl(Me.VSLongPrem.Value)
End Sub
but they don't work when I put data in VSShortPrem and VSLongPrem textboxes. Do I need to call them to the userform module? I am kind of a newbie at this level. Any more information need I would be happy to provide it.
Thanks in advance!
Bookmarks