Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,073
Default PasteSpecial Paste:= xlPasteFormats problem

When I manually Copy then Paste SpecialPaste 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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 510
Default PasteSpecial Paste:= xlPasteFormats problem

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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default PasteSpecial Paste:= xlPasteFormats problem

Worked fine for me in xl2000 and xl97.

--
Regards,
Tom Ogilvy



"Ken Johnson" wrote in message
oups.com...
When I manually Copy then Paste SpecialPaste 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



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,073
Default PasteSpecial Paste:= xlPasteFormats problem

Thanks Carim and Tom.
I'll have to keep trying.
At the moment it's got me beat.
Ken Johnson

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,073
Default PasteSpecial Paste:= xlPasteFormats problem

I've got it working now.
I must have just confused myself somehow when testing the code.
Ken Johnson

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cut, Copy, Paste, PasteSpecial grayed out. news.microsoft.com[_6_] Excel Discussion (Misc queries) 9 October 19th 17 08:45 PM
Paste vs PasteSpecial Gary''s Student Excel Programming 3 February 25th 06 06:29 PM
PasteSpecial xlPasteFormats ends macro itarnak Excel Programming 4 October 12th 05 02:44 PM
paste negative time with PasteSpecial Sylvian Excel Programming 20 September 2nd 05 06:03 AM
PasteSpecial Paste:=ColumnWidths Arvi Laanemets Excel Programming 3 February 8th 05 01:46 PM


All times are GMT +1. The time now is 01:40 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"