Forum Discussion
Conditional Formatting Ranges Increasing on Data Refresh
Can you share the code in part or whole?
- dappolanJul 18, 2023Copper Contributor
After reviewing my code and formatting rules, I've been unable to figure out a cause for this behavior. The formatting rules are written with absolute references, and while I do have code that inserts rows into the document, it does so to separate out events that occur on different dates, so when refreshing the data without changed entries, I would expect to see a predictable increase in the ranges, but this is not the case and the range increases far faster than the number of rows inserted. Additionally, if the code was interpreting the paste action as inserting rows, I would expect the initial increases in the format range to be much greater than they are. It's not the most elegant solution, but I've made a hidden sheet in the workbook to store my desired formatting, and my code now copies and pastes the formatting from that sheet to the operating sheet after performing the needed operations.
- dappolanJul 17, 2023Copper ContributorI'll check, and should be able to share the code as it's not even a little proprietary, but there shouldn't be any reason for it to be inserting columns. The range it's being copied to is cleared before pasting, and while the code subsequently calls macros that do involve deleting/inserting rows, I don't feel that this is the issue, as there's no discernible mathematical relationship between the range sizes at each step. I'll try to share some later.