Update Conditional Formatting 'Applies To Range'

mikeymay

Well-known Member
Joined
Jan 17, 2006
Messages
1,645
Office Version
  1. 365
Platform
  1. Windows
I am using CF to add borders to cells to create a 'table'
1720516815720.png


In column I I need to show notes for the customer but as these can be lenghty, I need to merge the cells in column I to display the note as below
1720516891848.png


My problem is that the CF set to show borders where required, are broken when I unmerge the merged cells
Below is the defined range prior to the merge
1720516975065.png


When the unmerge occurs, the range is amended to
1720517048741.png


As the merge and unmerge is part of a loop to define multiple individual lists of either 1 or many customers, I need to redefine the range after each list has been defined and the relevant cells merged.

As recording the fixing of the defined CF range doesn't record the required code, is there a way of defining the range via VBA?


TIA
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
an example:
VBA Code:
activesheet.usedrange.formatconditions(1).ModifyAppliesToRange activesheet.Range("B1:H101")
 
Upvote 0

Forum statistics

Threads
1,224,816
Messages
6,181,141
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