Hi,
I'm new to excel VBA. Hope someone can help me.
I am assigning value to a textbox inside a subroutine. There are 16 such scenarios. Now I want to add up all base and all Pand I values and store them in a different textbox. I was thinking of using a global variable but I've been unable to do it. Can someone help me?
Private Sub txtBase2_Change()
If Len(txtBase2.Text) <> 0 Then
dblBase = txtBase2.Value
End If
If Len(txtPandI2.Text) <> 0 Then
dblPandI = txtPandI2.Value
End If
dblTotal = dblBase + dblPandI
txtTotal2.Value = dblTotal
End Sub
I'm new to excel VBA. Hope someone can help me.
I am assigning value to a textbox inside a subroutine. There are 16 such scenarios. Now I want to add up all base and all Pand I values and store them in a different textbox. I was thinking of using a global variable but I've been unable to do it. Can someone help me?
Private Sub txtBase2_Change()
If Len(txtBase2.Text) <> 0 Then
dblBase = txtBase2.Value
End If
If Len(txtPandI2.Text) <> 0 Then
dblPandI = txtPandI2.Value
End If
dblTotal = dblBase + dblPandI
txtTotal2.Value = dblTotal
End Sub