Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 296
Default Is there a VBA PasteSpecial(PasteAllExceptFormats) ?

I'd like to be able to copy a column which includes formulae, values
and cell background colour formatting, and paste it to another column
which has different colour backgrounds.

I need to keep the formulae from the copied column and the formatting
for the object column.

I realise I can do a PasteAll, and then reset the original colours
with another line or two of code, but a single operation would be
preferable.

Any suggestions please?

Usual TIA




__
Richard Buttrey
Grappenhall, Cheshire, UK
__________________________
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Is there a VBA PasteSpecial(PasteAllExceptFormats) ?

Sorry... there is nothing in a single line. You are probably bet with a
regular paste and then put back the colours...
--
HTH...

Jim Thomlinson


"Richard Buttrey" wrote:

I'd like to be able to copy a column which includes formulae, values
and cell background colour formatting, and paste it to another column
which has different colour backgrounds.

I need to keep the formulae from the copied column and the formatting
for the object column.

I realise I can do a PasteAll, and then reset the original colours
with another line or two of code, but a single operation would be
preferable.

Any suggestions please?

Usual TIA




__
Richard Buttrey
Grappenhall, Cheshire, UK
__________________________

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,173
Default Is there a VBA PasteSpecial(PasteAllExceptFormats) ?

Richard

Would this work. It just pastes formulas and number formats (Constants will
copy too)

Sub copyAndPasteSpecial()
Dim rng As Range
Set rng = Range("A1:G100")
rng.Copy
Range("H1").PasteSpecial xlPasteFormulasAndNumberFormats
End Sub

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
www.nickhodge.co.uk
HIS


"Richard Buttrey" wrote in
message ...
I'd like to be able to copy a column which includes formulae, values
and cell background colour formatting, and paste it to another column
which has different colour backgrounds.

I need to keep the formulae from the copied column and the formatting
for the object column.

I realise I can do a PasteAll, and then reset the original colours
with another line or two of code, but a single operation would be
preferable.

Any suggestions please?

Usual TIA




__
Richard Buttrey
Grappenhall, Cheshire, UK
__________________________



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 296
Default Is there a VBA PasteSpecial(PasteAllExceptFormats) ?

On Wed, 12 Jul 2006 22:44:45 +0100, "Nick Hodge"
wrote:

Sub copyAndPasteSpecial()
Dim rng As Range
Set rng = Range("A1:G100")
rng.Copy
Range("H1").PasteSpecial xlPasteFormulasAndNumberFormats
End Sub



Excellent. Thanks Nick, just what I wanted.

It's funny, but I must have seen that prompted option hundreds of
times and it's never really registered with me before.

Many thanks,


__
Richard Buttrey
Grappenhall, Cheshire, UK
__________________________
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
PasteSpecial Kevin Excel Programming 3 October 7th 04 01:07 PM
pastespecial Jeff Excel Programming 4 September 28th 04 10:30 PM
PasteSpecial KL[_3_] Excel Programming 1 July 8th 04 02:07 PM
Pastespecial and cut Ron[_23_] Excel Programming 4 April 26th 04 02:14 AM
pastespecial Claude Excel Programming 2 February 24th 04 01:21 PM


All times are GMT +1. The time now is 05:05 AM.

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"