Hi, I just started practising VBA and have the following code
Sub CalculateRegularCommission()
Dim curValue As Currency
Dim curCommission As Currency
Dim curRate As Currency
Worksheets("Commission").Range("C7").Activate
curValue = ActiveCell.Value
curRate = 0.05
curCommission = curValue * curRate
MsgBox ("$" & curCommission)
Pressing F5 results in curCommission giving me a Dollar value with four decimal places, which I would like to reduce to just two. I googled severel techniques, but non seemed to quite work.
Why, for example, is putting
not doing the trick, but showing an error? Also, pressing F1 I see that dim As Currency should be 2 decimal places, why though are there in fact 4 decimal places in my case?
Thank you.
Bookmarks