ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Auto Decimal Place Application (https://www.excelbanter.com/excel-discussion-misc-queries/82542-auto-decimal-place-application.html)

[email protected]

Auto Decimal Place Application
 
Hi,

I have a spreadsheet that deals with numbers to different decimal
places at different times. Instead of manually going over the other
cells and changing via format number menus to 2dp or 3dp etc is there a
way to have a key single cell that I can set the format in and the rest
of the cells all follow suit?

IE in cell A1, I have the number 20.000, and in A2~A10 I have a range
of other numbers that will automatically adopt the 00.000 dp placement?

Thanks,

Slash.


JMB

Auto Decimal Place Application
 
What is wrong with selecting cells A1:A10, then performing the format
operation?
Excel has a formatting toolbar (View/Toolbars/Formatting) that has buttons
on it you can use to increment/decrement decimal places instead of going
through the format menus.


" wrote:

Hi,

I have a spreadsheet that deals with numbers to different decimal
places at different times. Instead of manually going over the other
cells and changing via format number menus to 2dp or 3dp etc is there a
way to have a key single cell that I can set the format in and the rest
of the cells all follow suit?

IE in cell A1, I have the number 20.000, and in A2~A10 I have a range
of other numbers that will automatically adopt the 00.000 dp placement?

Thanks,

Slash.



[email protected]

Auto Decimal Place Application
 
Caus its not that simple, the cells and rows are all over the place so
selecting them all to do a global dp change is long winded this is why
I was thinking of a key cell that all the others then are going to
follow suit to when I change that one cell.

Possibly a macro function?

Cheers,

Slash.


JMB

Auto Decimal Place Application
 
You could try naming the key cell and the target range. Then use a macro
like this and assign it to a button to make the number format the same. I'm
not sure how to make it automatic as I don't know of any events that are
triggered by changing the number format of a cell, otherwise you could use an
event handler.

Sub Test()
Range("TargetRange").NumberFormat = _
Range("KeyCell").NumberFormat
End Sub

" wrote:

Caus its not that simple, the cells and rows are all over the place so
selecting them all to do a global dp change is long winded this is why
I was thinking of a key cell that all the others then are going to
follow suit to when I change that one cell.

Possibly a macro function?

Cheers,

Slash.




All times are GMT +1. The time now is 12:03 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com