S
Steve
Morning all.
I'm going through multiple worksheets, and trying to make sure that the
values that are in the cells are what's actually showing.
I.e., fo rthe most part I set my numeric format to show two decimal places.
If however there are 3 decimals in the number, I need to show that. Or, if
there are 4 decimal places, I'll need to show them.
It's getting rather tedious going through each and every worksheet and doing
this one row at a time, manually.
As such, I'd like to do this with a macro.
So, my question is:
What code would I use to check to see the amount of actual decimal places
there are in a given number, and then set the number format to show the
decimal places that actually exist, with never less than 2 decimal places?
At this point, what's rolling through my mind is:
If activecell.value = 3 decimal place number then
set activecell.format = format("0.000")
else if activecell.value = 4 decimal place number then
set activecell.format = format("0.0000)
else
activecell.value = 2 decimal place number
set activecell.format = (format("0.00")
How would I perform this task?
I'm going through multiple worksheets, and trying to make sure that the
values that are in the cells are what's actually showing.
I.e., fo rthe most part I set my numeric format to show two decimal places.
If however there are 3 decimals in the number, I need to show that. Or, if
there are 4 decimal places, I'll need to show them.
It's getting rather tedious going through each and every worksheet and doing
this one row at a time, manually.
As such, I'd like to do this with a macro.
So, my question is:
What code would I use to check to see the amount of actual decimal places
there are in a given number, and then set the number format to show the
decimal places that actually exist, with never less than 2 decimal places?
At this point, what's rolling through my mind is:
If activecell.value = 3 decimal place number then
set activecell.format = format("0.000")
else if activecell.value = 4 decimal place number then
set activecell.format = format("0.0000)
else
activecell.value = 2 decimal place number
set activecell.format = (format("0.00")
How would I perform this task?