Hi i am trying to solve the following code below where i want to get the answers from the equations and populate the listbox with the answers. Can somebody how to do it the right way.
Private Sub Tolerance_Click()
Dim D As Integer
Dim L As Integer
Dim Ts As Double
Dim S As Double
Dim Ci As Double
Dim Cy As Double
Dim A As Double
Dim P As Double
Dim Tr As Double
Dim Cr As Double
D = TextBox1.Value
L = TextBox2.Value
Select Case D
Case Is >= 0.25
Ts = 0.001 + (0.006 + 0.005 * D)
Case Is < 0.25
Ts = 0.001 + (0.003 + 0.016 * D)
End Select
MsgBox Ts
S = L * 0.0087
Ci = 0.25 * S
Cy = S + Ci
Ci = Ts / 4
A = L * 0.0175
P = A + 0.01 + 0.001
Tr = A + 0.25 * (Ts)
Cr = A + Cy
With ListBox1
.AddItem "Ts"
.AddItem "S"
.AddItem "Ci"
.AddItem "Cy"
.AddItem "Ci"
.AddItem "A"
.AddItem "P"
.AddItem "Tr"
.AddItem "cr"
End With
End Sub
Bookmarks