+ Reply to Thread
Results 1 to 3 of 3

Textboxes formula depends on combobox value

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    02-26-2013
    Location
    Philippines
    MS-Off Ver
    Excel 2007
    Posts
    367

    Textboxes formula depends on combobox value

    Hello, i want to formula the three textboxes and display the result in textbox4 based on the value of combobox

    Combobox Values = Cost Budget, Revenue and Actual Hours

    Here's the formula per combobox values:

    Cost Budget = Funding * Actual Hours / Revenue (display the result in textbox4)
    Revenue = Funding * Actual Hours / Revenue (display the result in textbox4)
    Actual Hours = Revenue * Cost Budget / Funding (display the result in textbox4)

    Attached is the sample.
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    02-26-2013
    Location
    Philippines
    MS-Off Ver
    Excel 2007
    Posts
    367

    Re: Textboxes formula depends on combobox value

    I have this sample code formula for Cost Budget, but it seems i miss something????

    Private Sub TextBox1_Change()
    
    
    Select Case Me.ComboBox1.Value
    
    Case "Cost Budget"
    
      If IsNumeric(TextBox1) And IsNumeric(TextBox2) And IsNumeric(TextBox3) Then
           TextBox4 = TextBox1 * TextBox2 / TextBox3
        Else
            TextBox4 = ""
        End If
        
       
        
        Case "Revenue"
        
        If IsNumeric(TextBox1) And IsNumeric(TextBox2) And IsNumeric(TextBox3) Then
           TextBox4 = TextBox1 * TextBox2 / TextBox3
        Else
            TextBox4 = ""
        End If
        
      
        
           Case "Actual Hours"
        
         If IsNumeric(TextBox1) And IsNumeric(TextBox2) And IsNumeric(TextBox3) Then
           TextBox4 = TextBox1 * TextBox2 / TextBox3
        Else
            TextBox4 = ""
        End If
        
        End Select
        
        
    End Sub
    
    Private Sub TextBox2_Change()
    
    Select Case Me.ComboBox1.Value
    
    Case "Cost Budget"
    
      If IsNumeric(TextBox1) And IsNumeric(TextBox2) And IsNumeric(TextBox3) Then
           TextBox4 = TextBox1 * TextBox2 / TextBox3
        Else
            TextBox4 = ""
        End If
        
       
        
        If IsNumeric(TextBox1) And IsNumeric(TextBox2) And IsNumeric(TextBox3) Then
           TextBox4 = TextBox1 * TextBox2 / TextBox3
        Else
            TextBox4 = ""
        End If
        
      
        
        Case "Actual Hours"
        
         If IsNumeric(TextBox1) And IsNumeric(TextBox2) And IsNumeric(TextBox3) Then
           TextBox4 = TextBox1 * TextBox2 / TextBox3
        Else
            TextBox4 = ""
        End If
        
        End Select
        
    
    End Sub
    
    Private Sub TextBox3_Change()
    
    Select Case Me.ComboBox1.Value
    
    Case "Cost Budget"
    
      If IsNumeric(TextBox1) And IsNumeric(TextBox2) And IsNumeric(TextBox3) Then
           TextBox4 = TextBox1 * TextBox2 / TextBox3
        Else
            TextBox4 = ""
        End If
        
    
        
        If IsNumeric(TextBox1) And IsNumeric(TextBox2) And IsNumeric(TextBox3) Then
           TextBox4 = TextBox1 * TextBox2 / TextBox3
        Else
            TextBox4 = ""
        End If
        
     
        
           Case "Actual Hours"
        
         If IsNumeric(TextBox1) And IsNumeric(TextBox2) And IsNumeric(TextBox3) Then
           TextBox4 = TextBox1 * TextBox2 / TextBox3
        Else
            TextBox4 = ""
        End If
        
        End Select
        
    End Sub
    Last edited by puuts; 04-01-2013 at 12:21 PM.

  3. #3
    Forum Contributor
    Join Date
    02-26-2013
    Location
    Philippines
    MS-Off Ver
    Excel 2007
    Posts
    367

    Re: Textboxes formula depends on combobox value

    I've solved it. Closing thread.

+ Reply to Thread

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