View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.misc
Astroboy Astroboy is offline
external usenet poster
 
Posts: 20
Default How to Keep my Format ??

Hello,

Thank you for reply...

But the format still changed..

And this is what I did and please let me know if I did something wrong...

Right click on Sheet1 and choose View Code and pasted the code you gave to me

And copy cells from another template and Ctrl-V on template.xls..

But the format still changed...

Any Idea?

Thank you in advance...

"Gord Dibben" wrote:

Copy/paste this into the sheet module of your Template.xls

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
Application.CutCopyMode = False
.EnableEvents = True
End With
End Sub


Gord Dibben MS Excel MVP

On Mon, 10 Mar 2008 04:14:12 -0700, Astroboy
wrote:

Hello....

I have worksheet call Template.xls with format I like to use..(bold.. align
center..borders..etc.....)

But whenever I copy cells from another worksheet and paste on Template.xls
then my format is gone..(NO bold, align center...etc..)

So my question is ... is there any way to keeping my format? even though I
copy and paste from another wokrsheet...

Thanks in advance...