Results 1 to 3 of 3

Populating ListBox with answers from equations

Threaded View

  1. #1
    Registered User
    Join Date
    05-11-2010
    Location
    Portland oregon
    MS-Off Ver
    Excel 2007
    Posts
    10

    Populating ListBox with answers from equations

    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
    Last edited by peedarp1985; 05-18-2010 at 12:54 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1