Conditional formatting causing performance issues in workbook

eikogs

New Member
Joined
Aug 12, 2016
Messages
23
I have a workbook that I had intended to use Conditional Formatting to apply a 3 letter code as a prefix to a numerical value to indicate the currency being displayed. The code will change depending on the value of cell, “USD”, “EUR”, etc… I have 13 different codes in total, so there are 13 rules applied to many cells individually. I did it individually because there are some different colors and boarders on the cells and it was just easier to use the format painter and work through the sheet once rather than picking the cells on each of 13 rules. The conditional formatting alone works as expected, but it is have a significant impact on processing time of macros that run on the sheet. A macro that used to take 42 seconds now takes 62 seconds. That alone is tolerable, but the added time magnifies as this worksheet gets copied. It seems to be adding 20-30 seconds of processing time for each copy of this worksheet in the background, even though the macro does not touch the copies. I have tried shutting off calculations on the background copies, but it has no effect.

Is there another way that I can get a prefix in front of the numerical values that will not affect the performance of the workbook and can toggle values depending on the value of another cell? I do need the cell to keep its numerical value as they are dependents for other calculations.

I have tried changing calculations to manual, shutting off screen updating, even deleting all content from the sheets in question. Nothing puts a dent in the processing time except clearing the conditional formatting from the sheet.

I would estimate I have around 2500-3000 values on each worksheet that need this code.

How can I accomplish getting this 3 digit code to appear before my values without the negative impact on processing time? Is there a way to shut off formatting while processing, then turn it back on? Would it be more efficient to apply the rules to range instead of individually?

Thank you.
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
I was able to find a working solution to my issue by using a cell style and redefining the format of the cell style based on a change event.

ActiveWorkbook.Styles("MyStyle").NumberFormat = "_(""USD ""$* #,##0.00_);_(""USD ""$* (#,##0.00);_(""USD ""$* ""-""_);_(@_)"
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,021
Latest member
Justyna P

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