Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Controlsource overwriting Excel formulas

Status
Not open for further replies.

501blues

IS-IT--Management
Aug 1, 2002
9
US
Ok, this one has probably been answered but I could not find the answer on this site.

Here is my problem:

I have a userform with text fields that point to a spreadsheet formula. This pointing is all done by the userform in the properties area for that given field. The field name on the userform is txtTaxPrem which points to a cell on the spreadsheet called TaxPrem

Under the Data
Data:
Controlsource TaxPrem
Value 100

When spreadsheet value changes for TaxPrem the formula is wiped out and is replace with a new value. Can anyone help me out? This is driving me crazy.
 
Hi,

You can't enter data into a cell containing a formula and expect the formula to remain.

What are you trying to accomplish?

Skip,

Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
SkipVought,

It is as simple as basic addition. I enter some numbers into some fields and those numbers are calculated. The calculation is what I want to show on the userform. I am not entering data into the calc field per say, no more than when you enter numbers into cells on a worksheet and they go through a summation.

Basically the user enters some numbers and from those numbers formulas are applied. I was having the worksheet do the calculation because it made it easier than having to recalculate everytime they changed the figures. Does this help.
 
So you have a CELL that contains a formula and you want the value in the cell to appear in the Userform Textbox named txtTaxPrem.

What EVENT is evoked to process this?

If your formula were in A1
Code:
Userform1.txtTaxPrem.Value = [A1].Value



Skip,

Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
No event is being called. I made up a basic userform and worksheet.

On the worksheet there are three cells:

Cell Name of Cell
A1 Num1
A2 Num2
A3 AddNum

A3 contains the formula = Num1 + Num2

On the userform I have three fields.
txtNum1
txtNum2
txtSum

When I enter numbers in the fields txtNum1 and txtNum2 I want it to add them via the worksheet and display that number in txtSum. Can this be done?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top