Thread: How do I?
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Barry-Jon Barry-Jon is offline
external usenet poster
 
Posts: 17
Default How do I?

Use the chaneg events for the two "input" boxes to call a proc that
will update the total box. You will also need to handle errors and
non-numeric input. The basics are below. Please let me know if this
is what you were looking for.

Private Sub f5_Change()

RecalcTotal

End Sub

Private Sub f6_Change()

RecalcTotal

End Sub

Private Sub RecalcTotal()

Dim dblF5 As Double
Dim dblF6 As Double

If IsNumeric(Me.f5.Value) And IsNumeric(Me.f6.Value) Then

dblF5 = CDbl(Me.f5.Value)
dblF6 = CDbl(Me.f6.Value)

Me.total.Value = dblF5 + dblF6

Else

'handle non numeric input here

End If

End Sub