PDA

View Full Version : Do Calculation with Form before I enter on worksheet



Djblois
03-30-2007, 08:18 AM
I created a form for users to enter a number in but now I want need to do a math calculation before I enter it on the spreadsheet. This is what I tried:

Range("B71").formular1c1 = (=PandL2.Interest1.Value*.01)

PandL2 is the form and interest1 is the textbox

lucas
03-30-2007, 08:35 AM
Range("B71").FormulaR1C1 = (Interest1.Value * 0.01)
what's up with the = sign?
this isn't formatted...it only puts a number in B71
if you use 100 in the textbox it will return only a 1

Djblois
03-30-2007, 08:38 AM
I am doing the formating on the next line now

Bob Phillips
03-30-2007, 08:41 AM
To get a value from a form's control, use



Range("B71").Value PandL2.Interest1.Value*.01


but the form will still need to be loaded, otherwise it fails.

lucas
03-30-2007, 08:47 AM
Range("B71").FormulaR1C1 = Format(CDbl(Interest1.Value) * 0.01, "0.00%")