VBA copy / paste

User avatar
Steve_in_Kent
4StarLounger
Posts: 419
Joined: 04 Feb 2010, 11:46

VBA copy / paste

Post by Steve_in_Kent »

I'm using this sort of code, to copy from one worksheet to another.. it copies over ok... but, it then asks about ''you have copied a large amount of data to the clipboard.. do you want to.. etc..'' to which you have to click NO each time.

is there a way in the paste options to stop this message, (in vba i don't want to paste it elsewhere)

Code: Select all

FoundLine = 16
Backend = 999
   With wbkSource.Sheets("Daily")
         .Range("C" & FoundLine & ":" & "J" & Backend).Copy
    End With
With ThisWorkbook.ActiveSheet
    .Range("AP15").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
End With
Thanks

steve
----------------------------------------------------------------------------------------
Owing at LEAST 34 beers to other helpful forum members. Especially HansV!

User avatar
HansV
Administrator
Posts: 78487
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: VBA copy / paste

Post by HansV »

You can clear the clipboard by adding the line

Application.CutCopyMode = False

below the code that pastes.
Best wishes,
Hans

User avatar
Steve_in_Kent
4StarLounger
Posts: 419
Joined: 04 Feb 2010, 11:46

Re: VBA copy / paste

Post by Steve_in_Kent »

cheers hans.. works a treat
----------------------------------------------------------------------------------------
Owing at LEAST 34 beers to other helpful forum members. Especially HansV!