PDA

View Full Version : Dislay an asterisk after a number



av8tordude
01-15-2011, 03:07 PM
I have the code below that displays the total calculation of a single column. how do I display this number with an asterisk (i.e. 9965.75*)

frmPDCalc.Test5B.Caption = Format(.SumIf(Range("B11:B375"), "<=" & CSng(This_Date), Range("I11:I375")), "$##,###0.00" & "*")

p45cal
01-15-2011, 07:05 PM
frmPDCalc.Test5B.Caption = Format(.SumIf(Range("B11:B375"), "<=" & CSng(This_Date), Range("I11:I375")), "$##,###0.00\*") untested.

av8tordude
01-16-2011, 06:44 PM
The code given accomplishes what I'm trying to acheive, but because their is an asterisk after the currency value, other parts of my code are triggering an error. My speculation is the the other parts of the code is not reading the value as a currency number because of the value.

Is there a way to include the asterisk, but still be read as a currency value?

p45cal
01-16-2011, 06:51 PM
...but because their is an asterisk after the currency value, other parts of my code are triggering an error...
Is there a way to include the asterisk, but still be read as a currency value?Probably.
Let's have some examples of the kind of code which causes an error (just a line or two in each case if possible)?

av8tordude
01-16-2011, 07:00 PM
This part of my code errors. When it errors, I moved my cursor over "EL6B.caption" to see what the currency value is and it displays the currency number with the asterisk.


DL8B.Caption = Format(CCur(Replace(Replace(EL6B.caption, "$", ""), ",", "")) - CCur(Replace(Replace(Test7B.Caption, "$", ""), ",", "")), "$##,###0.00")

av8tordude
01-16-2011, 07:54 PM
Ok..I found a workaround for my problem. I replaced the $ with an asterisk symbol

p45cal
01-17-2011, 01:24 AM
By doing calculations with captions you are doing maths on strings. Captions are for humans to read. Perhaps you could hold the values you want to do calculations on, in variables (or cells) of the correct type (numeric). Then use those results, modified as you want, say with Format, to display the result to humans as a string caption.