Decimal Place Formatting Based On Another Cells Value

mholz

New Member
Joined
Aug 21, 2017
Messages
1
First post!
I searched/read as many posts as I could but could not find that matching my problem.

I have a work sheet that uses allot of =if() and =choose() formulas. Based on what a cells value is though I would like that to determine the number of decimal places shown in unlocked(manual entry) and locked (calculated) cells. I have 15 different cell values (cases) that need to be broken into 4 different decimal digit possibilities (0,2,3 and 4 digits).

Example1: Cell A1=Case1 or Case2 or Case3 or Case4; Cells GHI28, JKL28 and MNO28 will have 0 digits displayed after decimal place.

Example2: Cell A1=Case5 or Case6; Cells GHI28, JKL28 and MNO28 will have 2 digits displayed after decimal place.

Additionally I am doing this across 20 rows, so will have 20 triggers cells (one for each row) and formatting 60 cells (3 per trigger cell)

I know that this can't be done in "Conditional formatting" but can be done in VBA, if one could be so kind as to assist me with the VBA code need to achieve my desired request I would greatly appreciated it.

I hope that my explanation is clear enough to assist you in assisting me.

Thanks in advance and have a nice day.
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.

Forum statistics

Threads
1,223,970
Messages
6,175,718
Members
452,667
Latest member
vanessavalentino83

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