Userform Development
That was extremely helpful and yes it would be great to have it auto calc. if
possible.
I am now trying to get the SUM to show decimals (to 2 places only), which is
getting the best of me right now.
Any thoughts
"Susan" wrote:
bassmanfranc -
no, there is no limit to the number of textboxes, except for the size
of your userform. but you can get around that by using a multiform
with several pages (will increase the amount of space for textboxes).
as for performing calculations, you can do that.... see example below:
Option Explicit
Sub userform1_initialize()
TextBox1.Value = ""
TextBox2.Value = ""
TextBox3.Value = ""
End Sub
Sub commandbutton1_click()
Dim TextBox1 As Control
Dim TextBox2 As Control
Dim TextBox3 As Control
Dim SUM As Integer
SUM = Me.TextBox1.Value / Me.TextBox2.Value
Me.TextBox3.Value = SUM
End Sub
but it doesn't calculate until you click the control button, which i
labeled "calculate". maybe somebody else can have it automatically
calculate with an event change tabbing from textbox2..........
hth!
susan
bassmanfranc wrote:
Excel 2003
I am developing a userform in Excel using MS Visual Basic
I would like to be able to have a form text box (?) perform a calculation
using numbers entered in previous fields, show the result of that calculation
immediately for visual confirmation and then enter that result in the proper
field in the database.
Example... enter the following into form fields:
Contract Cost: (enter no.)
Hard Costs: (enter no.)
Mark Up: (enter no.)
Gross Margin %: (formula; based on Markup/Contract Cost) (View this data
immediately on the form and then upon submitting form entering calculation in
GM% column with this project.
Also are there any limitations as to how many fields I can enter onto a
custom userform?
Thanks for any help!
|