userform help ... combobox times textbox = emptyrow

eric86vabeach

New Member
Joined
Jan 29, 2014
Messages
23
hello im working on a userform in excel i would like to have a combobox that has the words "yes" and "no" then after the user picks "yes" then it would take the textbox187.value * 4 (it needs to times it by 4) then it puts the value in emptyrow, 26 ...... OR if the user picks "no" then it would take the textbox187.value * 4 (it needs to times it by 4) then it puts the value in enptyrow, 27


If Me.ComboBox26.Value = "YES" Then
Me.ComboBox26.Value = Int(Me.TextBox187.Value) * 4
Cells(emptyRow, 26).Value = Me.ComboBox26.Value


If Me.ComboBox26.Value = "NO" Then
Me.ComboBox26.Value = Int(Me.TextBox187.Value) * 4
Cells(emptyRow, 27).Value = Me.ComboBox26.Value
End If


this is what i have tryed but its not working plz help me !!!


thanks for your time
eric
 
Have you defined your emptyrow?

Something like this maybe
Code:
Private Sub ComboBox1_Change()
    emptyrow = Range("A" & Rows.Count).End(xlUp).Offset(1, 0).Row
    
    If Me.ComboBox26.Value = "YES" Then
        Me.ComboBox26.Value = Int(Me.TextBox187.Value) * 4
        Cells(emptyrow, 26).Value = Me.ComboBox26.Value
    ElseIf Me.ComboBox26.Value = "NO" Then
        Me.ComboBox26.Value = Int(Me.TextBox187.Value) * 4
        Cells(emptyrow, 27).Value = Me.ComboBox26.Value
    End If
End Sub
 
Last edited:
Upvote 0
emptyrow
emptyrow = WorksheetFunction.CountA(Range("A:A")) + 1

THANKS SO MUCH IT WORKS !! !! ! ! ! YOUR THE BEST ! ! ! ! !! ! THANKS FOR YOUR TIME
 
Upvote 0

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top