View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Fausto Arinos Barbuto Fausto Arinos Barbuto is offline
external usenet poster
 
Posts: 7
Default Save value on form


"scantor145"

Excel 2003 w/Visual Basic 6.3


At a point in my macro I calculate a value, and then assign that value
to a text box on another form. My questions a


1) Can that value be saved on the form so that the next time I run the
macro the value in the text box is already stored?


2) Can the value in the text box be formatted, e.g. to display only 2
decimal places


Well, at least in Excel you can use Round(). For example:

TextBox1.Text = Round(variable,4)

"variable" will then be displayed as 4-decimal place figure in TextBox1.
You might also embellish the display, for example:

TextBox1.Text = "Execution time: " & Round(variable,4) & " seconds."

---Fausto