Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / March 2006

Tip: Looking for answers? Try searching our database.

PasteSpecial Paste:= xlPasteFormats problem

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ken Johnson - 19 Mar 2006 15:27 GMT
When I manually Copy then Paste Special>Paste Formats only the formats
are pasted, not the values.
However, when I use the following code in a WorksheetChange Sub...

Cells(1,1).Copy
Target.PasteSpecial Paste:= xlPasteFormats

the value from A1 is also pasted. I want Target to keep it values, not
have them changed to A1's value.
What do I have to do to stop the value from being pasted too?
At the moment I'm using a variant array to store the original values in
Target then feeding those values back into Target after the format has
been pasted.
I am hoping there is an easier way to get the code to work the same way
as the manual process.

Ken Johnson
Carim - 19 Mar 2006 16:30 GMT
Hi Ken,

Your code works fine with me ...
Used both ActiveCell and Selection instead of Target, and got all
formats as well as conditional formatting copied ...
HTH
Cheers
Carim
Tom Ogilvy - 19 Mar 2006 18:32 GMT
Worked fine for me in xl2000 and xl97.

Signature

Regards,
Tom Ogilvy

> When I manually Copy then Paste Special>Paste Formats only the formats
> are pasted, not the values.
[quoted text clipped - 13 lines]
>
> Ken Johnson
Ken Johnson - 19 Mar 2006 21:37 GMT
Thanks Carim and Tom.
I'll have to keep trying.
At the moment it's got me beat.
Ken Johnson
Ken Johnson - 21 Mar 2006 12:25 GMT
I've got it working now.
I must have just confused myself somehow when testing the code.
Ken Johnson
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.