LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default UserForm Label & Format Problems

I'm trying to format some labels on a UserForm but am not getting results I
expect. The formats don't seem to act the same as if one were formatting a
cell in a worksheet. In fact, I had used these formats when formatting a
worksheet cell using a macro in a standard module and got the desired
results. Now that I am building a UserForm do to the same things, I get
different results. Any input into what I may be doing wrong would be
sincerely appreciated.


1. Me.ClosestLabel.Caption = "Closest: " & Format(MySum, "General")

will produce a label like "Closest: Ge43eral" if MySum, a declared Double
variable, has a value of 1843.78. If I try

Me.ClosestLabel.Caption = "Closest: " & Format(MySum, "0")

the label reads "Closest: 1843" for MySum with a value of 1843.78.


2. Me.IterationsLabel.Caption = "Iterations: " & Format(Counter,
"#,##0_);(#,##0);""-""_)")

produces labels like "Iterations: 145_)" for Counter, a declared Long
variable, being a positive number. This is different from how cells can be
formatted in that the "_)" is displayed instead of just leaving a space for
the right parenthesis.


3. Me.ElapsedTimeLabel.Caption = "Elapsed time: " & Format(Now -
StartTime, "[h]:mm:ss")

will show a value of ":12:02" after an elapsed time of two seconds.
StartTime is declared as a Double variable, and had previously been sent to
Now. I had expected it to show "0:00:02".


Mark



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Userform Label Steve[_9_] Excel Discussion (Misc queries) 7 October 29th 07 09:51 PM
changing selected label on userform w/ a variable mike k Excel Programming 1 February 19th 04 01:48 AM
Userform Textbox Currency Format Problems Dunce in SC Excel Programming 2 October 27th 03 12:45 AM
Making a TextBox look and feel like a Label in a userform Mike NG Excel Programming 0 July 30th 03 08:34 PM
Making a TextBox look and feel like a Label in a userform Mike NG Excel Programming 0 July 29th 03 11:52 PM


All times are GMT +1. The time now is 03:08 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"