I have an equation that I would like to be able to have spit out 3 different outputs depending on which opion button is highlighted (Standard, Conservative, Aggresive). I cannot seem to get the equation to work for Conservative or Aggressive. Any help would be great.Tyler
Code:
Private Sub CommandButton1_Click()
'This is the calculate button
Dim lRow As Long
Dim ws As Worksheet
Set ws = Sheet5
If IsNumeric(TextBox3.Value) And IsNumeric(TextBox1.Value) And IsNumeric(TextBox2.Value) Then
'Calculates tool cost based on input width and pich
Cost = (Sheet7.Range("J18") * TextBox3.Value) + (Sheet7.Range("J19") * TextBox1.Value) + (Sheet7.Range("J20") * TextBox2.Value) + Sheet7.Range("J17")
End If
If ActiveSheet.Shapes("OptionButton1").ControlFormat.Value = True Then
'Returns cost to worksheet if standard is highlighted
Range("L16").Value = Cost
'Returns cost to worksheet if Conservative is highlighted
Else If ActiveSheet.Shapes("OptionButton2").ControlFormat.Value = True Then
Range("L16").Value = Cost * 1.1
'Returns cost to worksheet if Aggresive is highlighted
Else If ActiveSheet.Shapes("OptionButton3").ControlFormat.Value = 1 Then
Range("L16").Value = Cost * 0.9
End If
End Sub