Hi folks - I have something that almost works. here's the code
Private Sub cboDeductible_Change()
Dim TIVvalue
TIVvalue = Worksheets("EquipBreakdown2"
.Range("c7"![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
Call PremCalc(TIVvalue)
End Sub
Function PremCalc(TIV) As Currency
Dim Deductible
Deductible = Sheet7.cboDeductible.Value
Select Case TIV
Case Is < 6000001
PremCalc = 500
Case Is < 15000000
If Deductible = 1000 Then
PremCalc = TIV * 0.0827
ElseIf Deductible = 2500 Then
PremCalc = TIV * 0.0735
ElseIf Deductible = 5000 Then
PremCalc = TIV * 0.661
End If
Case Is >= 15000000
If Deductible = 1000 Then
PremCalc = TIV * 0.0816
ElseIf Deductible = 2500 Then
PremCalc = TIV * 0.0735
ElseIf Deductible = 5000 Then
PremCalc = TIV * 0.661
End If
End Select
End Function
The PremCalc variable changes dependent on the TIV value someone enters in cell c7. Right next to that I have cboDeductible that can either be 1000, 2500, or 5000.
When I run the code in debug mode, everything calculates correctly. The PremCalc immediately updates on the spreadsheet when someone enters a someting in cell c7. However, the sheet DOES NOT update to the new PremCalc value whevever someone changes the deductible in the combo box EVEN THOUGH it calculates correctly in debug mode.
Why isn't excel updating to my new PremCalc value when I use the combo box?? I tried hitting f9 to recalc, but that didn't work.
HELP!!
[/color] Q: Why is my computer doing that?
A: Random Perversity of Inanimate
Objects
Private Sub cboDeductible_Change()
Dim TIVvalue
TIVvalue = Worksheets("EquipBreakdown2"
Call PremCalc(TIVvalue)
End Sub
Function PremCalc(TIV) As Currency
Dim Deductible
Deductible = Sheet7.cboDeductible.Value
Select Case TIV
Case Is < 6000001
PremCalc = 500
Case Is < 15000000
If Deductible = 1000 Then
PremCalc = TIV * 0.0827
ElseIf Deductible = 2500 Then
PremCalc = TIV * 0.0735
ElseIf Deductible = 5000 Then
PremCalc = TIV * 0.661
End If
Case Is >= 15000000
If Deductible = 1000 Then
PremCalc = TIV * 0.0816
ElseIf Deductible = 2500 Then
PremCalc = TIV * 0.0735
ElseIf Deductible = 5000 Then
PremCalc = TIV * 0.661
End If
End Select
End Function
The PremCalc variable changes dependent on the TIV value someone enters in cell c7. Right next to that I have cboDeductible that can either be 1000, 2500, or 5000.
When I run the code in debug mode, everything calculates correctly. The PremCalc immediately updates on the spreadsheet when someone enters a someting in cell c7. However, the sheet DOES NOT update to the new PremCalc value whevever someone changes the deductible in the combo box EVEN THOUGH it calculates correctly in debug mode.
Why isn't excel updating to my new PremCalc value when I use the combo box?? I tried hitting f9 to recalc, but that didn't work.
HELP!!
[/color] Q: Why is my computer doing that?
A: Random Perversity of Inanimate
Objects