VBA code to protect cell color and border

May 13, 2013 at 07:04:43
Specs: Windows 7
Hi, Newbie10

I'm trying to write excel vba code to protect cell color and border (c5:c20) that I don't want to change when copy paste value into the cells.No need to define the color and border.

Thanks in advance!


See More: VBA code to protect cell color and border

Report •

#1
May 13, 2013 at 12:11:03
Hi simba11,

I think the way you can get around this is to paste values instead of pasting the value and the formatting by doing a standard paste. Here is an example using the information you gave above:

ActiveSheet.Range("C5:C20").PasteSpecial xlPasteValues

Law of Logical Argument: Anything is possible if you don't know what you're talking about.


Report •
Related Solutions


Ask Question