Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 118
Default Paste Special

Hii All
The following code works fine:
range("F12").Copy
range("F13:F" & lrow - 1).PasteSpecial (xlPasteFormats)

I tried to reduce it to the following and it gives an App error:
range("F12").Copy range("F13:F" & lrow - 1).PasteSpecial(xlPasteFormats)

It seems to be quite happy to accept the line of code when I type it in.
Where is it wrong ??
Any advice is appreciated
Regards
Michael M
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 118
Default Paste Special

Thanks Martin
I read through my code books and basically there was no reference to what I
was trying to do.....which usually means, very difficult to do.
I appreciate your input but don't think for my small needs it will be
necessary.
I was simply trying to "clean up" my existing code.

Regards
Michael M

"Martin Fishlock" wrote:

You cannot reduce the paste special code. The copy command either copies the
source to the clipboard or to a destination using the normal paste conditions.

A solution is to write a subroutine to do a copy paste

Sub mycopypaste(CopyFrom As Range, CopyTo As Range, PasteConditions)
CopyFrom.Copy
CopyTo.PasteSpecial PasteConditions
End Sub

--
Hope this helps
Martin Fishlock, Bangkok, Thailand
Please do not forget to rate this reply.


"Michael M" wrote:

Hii All
The following code works fine:
range("F12").Copy
range("F13:F" & lrow - 1).PasteSpecial (xlPasteFormats)

I tried to reduce it to the following and it gives an App error:
range("F12").Copy range("F13:F" & lrow - 1).PasteSpecial(xlPasteFormats)

It seems to be quite happy to accept the line of code when I type it in.
Where is it wrong ??
Any advice is appreciated
Regards
Michael M

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
Can't Copy and Paste or Paste Special between Excel Workbooks wllee Excel Discussion (Misc queries) 5 April 29th 23 03:43 AM
Paste and Paste Special No Longer Working - Excel 2003 SheriJ Excel Discussion (Misc queries) 2 January 15th 09 09:23 PM
In Excel: add a Paste-Special Option to paste IN REVERSE ORDER. stan-the-man Excel Worksheet Functions 7 June 14th 06 08:10 PM
How do I capture user paste action and convert to Paste Special DonC Excel Programming 0 November 19th 04 01:43 PM
Dynamic Copy/Paste Special Formulas/Paste Special Values Sharon Perez Excel Programming 3 August 7th 04 09:49 PM


All times are GMT +1. The time now is 03:23 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"