Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
PasteSpecial value
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
PasteSpecial value
delete the underscore character
-- Gary Keramidas Excel 2003 "Atif" wrote in message ... 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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
PasteSpecial value
thank you Gary & Chip;
following code worked for me; vSourceWS.Range("N500:W" & vSourceLastRow + 1).Copy vTargetWS.Range("F" & vTargetLastRow + 1).PasteSpecial Paste:=xlPasteValues "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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Why need to use Selection.PasteSpecial vs myRange.PasteSpecial | Excel Programming | |||
Help with PasteSpecial | Excel Programming | |||
PasteSpecial | Excel Programming | |||
pastespecial | Excel Programming | |||
pastespecial | Excel Programming |