Copy ONLY Conditional Formatting rule with NO other cell formatting

julhs

Active Member
Joined
Dec 3, 2018
Messages
407
Office Version
  1. 2010
Platform
  1. Windows
The cell that contains the CF rule I want to copy has got border format applied, so when using this:-
Excel Formula:
PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False.
the border format is also copied, is there a way to prevent this.
The only thing I can think of would be to delete the borders after the cells are pasted.
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Thanks senerynm.
Had consider this thread to be dead.
I ended up going down the route of removing the borders of the copy/ pasted cells.
Not tested what you gave but it would save the need for an extra line of code to remove the borders.
 
Upvote 0
Have tried what you suggested; but Conditional Format rules didn’t get copied, just the value in the cell and its formatting.
This is what I had come up with and it works for me, it copies the Conditional Format rules but then has to delete the copied borders (line style).
Excel Formula:
CFcell.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
CFcell.Borders.LineStyle = xlNone
Very speculative, but just wondering whether me having applying the borders using “Line Style” from the “Draw Borders” collection and not the “Borders” collection is why your suggestion didn’t work for me??
 
Upvote 0

Forum statistics

Threads
1,214,950
Messages
6,122,436
Members
449,083
Latest member
Ava19

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