dependent cells to follow decimal formatting of parent cell

rmlax

New Member
Joined
Aug 19, 2019
Messages
3
Hello,


New to this forum, I thank you for your help in advance.


I need dependent cells to follow the decimal formatting of a one parent cell. I've done this with format painter but my parent cell decimal requirements changes from time to time and I need the dependent cells to adjust and update accordingly.


Sometimes I might need to show no decimal places while other times I'll need to show one, or possibly two places.


In short, I want to change the decimal formatting of the parent cell and have this dictate the dependent cells on a per case basis.


Please see the following screenshots for examples of what I want to accomplish.


For example only, the Parent cell is in red, dependent cells in yellow. I don't need anything other than the decimal formatting to be copied so color is not an issue.

scenario1-3.jpg



Thank you!
XCxyBTz
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Hi & welcome to MrExcel.
How about
Code:
Sub RMLAX()
   Range("F2").Dependents.NumberFormat = Range("F2").NumberFormat
End Sub
Simply run the macro whenever you change the format of F2
 
Upvote 0
Thanks for this. Where in the code am I calling out the dependent cells, the cells that are to be affected.?


Hi & welcome to MrExcel.
How about
Code:
Sub RMLAX()
   Range("F2").Dependents.NumberFormat = Range("F2").NumberFormat
End Sub
Simply run the macro whenever you change the format of F2
 
Upvote 0
With the part in blue
Code:
[COLOR=#0000ff]Range("F2").Dependents[/COLOR].NumberFormat = Range("F2").NumberFormat
 
Upvote 0
Great, this worked fine. My line ended up looking like
Code:
 Range("D15,F15,H15...[COLOR=#0000ff]")[/COLOR][COLOR=#333333].NumberFormat = Range("F14").NumberFormat[/COLOR]
.

Thanks again!
 
Upvote 0
You're welcome & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,223,896
Messages
6,175,265
Members
452,627
Latest member
KitkatToby

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top