Command button calculation from Userform and Cell reference
something like:
Private Sub CommandButton1_Click()
If ListBox1.Value < "" And TextBox1.Value < "" Then
MsgBox "Total Purchase price is " & ListBox1.Value * TextBox1.Value
End If
End Sub
Where Listbox1 = Product
and
Textbox1 = Quanity
Corey....
"SDH" wrote in message
...
I have a userform that has a 'Product' listbox and a 'Quantity' textbox. The
cost of the 'Product' is on a product worksheet. I have a command button on
the Userform called 'Cost'. When clicked i need this button to calculate the
cost of the purchase i.e. purchase price = 'quantity' in text box multiplied
by cost of product. I would like it to be displayed either in a userform or a
message box with an ok button.
|