Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 244
Default number of decimals

Hi! I have a userform attached to a macro. when the macro runs the user can
see how much of the process has been made. I show this in percentage form.
However I do not know how to adjust the number of decimals so now it looks
like this: Completion: 11,23652357754356%. Needless to say it does not look
good. Can anyone help me with this please?

Here I calculate the percentage:
.Caption2 = "Process completion: " & CStr((pos / lngListLength)) * 100 & "
% "

and in a class module i set properties:
Property Let Caption2(strCaption As String)
frmProgress.lblMsg2.Caption = strCaption
DoEvents
End Property

please help me! any help appreciated! thanks alot
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default number of decimals

demo'd from the immediate window:

pos = 20
ListLength = 194
? pos/Listlength
0.103092783505155
? format(pos / ListLength,"0.0%")
10.3%


--
Regards,
Tom Ogilvy


"Arne Hegefors" wrote:

Hi! I have a userform attached to a macro. when the macro runs the user can
see how much of the process has been made. I show this in percentage form.
However I do not know how to adjust the number of decimals so now it looks
like this: Completion: 11,23652357754356%. Needless to say it does not look
good. Can anyone help me with this please?

Here I calculate the percentage:
.Caption2 = "Process completion: " & CStr((pos / lngListLength)) * 100 & "
% "

and in a class module i set properties:
Property Let Caption2(strCaption As String)
frmProgress.lblMsg2.Caption = strCaption
DoEvents
End Property

please help me! any help appreciated! thanks alot

Reply
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
Omitting the whole number when formatting decimals BunnyHop Excel Discussion (Misc queries) 11 July 21st 09 09:20 PM
Whole Number and Decimals Charles Knight Excel Discussion (Misc queries) 4 March 7th 07 11:55 PM
How do I show only the whole number w/o eliminating four decimals? kell~0 Excel Worksheet Functions 21 March 6th 07 05:35 PM
Displaying decimals that go in to a given number weSky Excel Discussion (Misc queries) 1 June 7th 06 09:54 AM
How do I change the number format for decimals from , to .? Nicole Setting up and Configuration of Excel 2 December 13th 05 05:31 AM


All times are GMT +1. The time now is 03:47 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"