I have a formula in cell B10 which is a product of values in cells B8 and B9 and returns the value of 65.327.
I also have a value of 3 in cell B12.
I would like cell B10 which contains the formula, to be rounded off to decimal places indicated by cell B12. Hence the formula in cell B10 would go like this:
The decimal places to which the formula will round off the answer, will depend on the value in cell B12.Code:=ROUND(B8*B9,$B$12)
That is all simple, but, I also need the formatting of cell B10 to change as per the decimal places indicated by cell B12. Hence cell B10 should read 65, 65.3, 65.33 or 65.327, depending on the value of cell B12 being 0, 1, 2 or 3.
To make matters worse, the spreadsheet will be password protected.
So how can this be achieved?
While I am familiar with Excel, I know nothing about VBA.
Regards
Presumably a custom format applied to B10 of #.### is not acceptable given 0 decimals would generate 65. rather than 65
My Recommended Reading:
Volatility
Sumproduct & Arrays
Pivot Intro
Email from XL - VBA & Outlook VBA
Function Dictionary & Function Translations
Dynamic Named Ranges
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks