View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default PasteSpecial value



The following worked for me:

Worksheets("Sheet1").Range("B5").CurrentRegion.Cop y
Worksheets("sheet2").Range("C10").PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False

Perhaps the problem is that you have a line continuation character
sequence (<space<underscore) at then end of the line that ends with
Copy, so the two lines beginning with vSourceWS and VTargetWS are
being combined into a single line of code, and the resulting code is
not syntactically correct. Get rid of the "_" at the end of the line
and you should be all set.

Cordially,
Chip Pearson
Microsoft MVP 1998 - 2010
Pearson Software Consulting, LLC
www.cpearson.com
[email on web site]





On Tue, 5 Jan 2010 13:53:01 -0800, Atif
wrote:

Here are two example of Code. Trying to copy Range of cells from SourceWS to
TargetWS.

This code working fine, as I have formula at Source its copy Formul.
vSourceWS.Range("N" & vSourceLastRow).CurrentRegion.Copy vTargetWS.Range("F"
& vTargetLastRow)

I tried to use PasteSpecial in result receiving Syntex Error
vSourceWS.Range("N" & vSourceLastRow).CurrentRegion.Copy _
vTargetWS.Range("F" & vTargetLastRow).PasteSpecial Paste:=xlPasteValues

Whats worng!

Regards
Atif