How do I lock in formatting on a worksheet
Roger
Found this event code posted by someone you could use.
Private Sub Worksheet_Change(ByVal Target As Range)
'retain formatting when a cell is copied over
Dim myValue
With Application
.EnableEvents = False
myValue = Target.Value
.Undo
Target = myValue
.EnableEvents = True
End With
End Sub
This is sheet event code. Right-click on the sheet tab and "View Code".
Copy/paste the above into that module.
Gord Dibben MS Excel MVP
On Fri, 22 Dec 2006 10:50:01 -0800, RogueBiscuit
wrote:
Thanks for your response. I know how to do that. I'm looking for something
a little different.
I work in finance and use financial statements all day. I have a "shell"
template for income statements and the like. I want to lock the formatting
of the shell (meaning borders, bolding, font size and such) and be able to
put data in without doing PasteSpecial.
"CLR" wrote:
Copy PasteSpecial Values, or Copy PasteSpecial Formulas, either
should leave the formatting intact...........
hth
Vaya con Dios,
Chuck, CABGx3
"RogueBiscuit" wrote:
When I put together spreadsheet I often have formatting that I would like to
be static. Then I can copy and paste values and formulas from other cells in
the worksheet without altering the format in the destination cell. Can
anyone help me do this? Thanks
Andrew
|