Exit code

  • Thread starter Thread starter Heather
  • Start date Start date
H

Heather

hi, I have a quick ? I'm guessing it's easy but I can't find the answer. I
have some code that ends up copying something and then pasting it into a tab
correctly but seems to hang up on it after it pastes with this below:
Select destination and Press Enter or Choose Paste
is there something I can add to it so that it'll get out of that mode?

here's my code
Worksheets(CStr(Trim(wsSource.Range("A12")) & " Platform")).Activate
Range("I7:N19").Select
Selection.Copy
ws.Activate
target.Offset(3, 0).Select
Selection.PasteSpecial Paste:=xlPasteValues
Selection.PasteSpecial Paste:=xlPasteFormats

Thank you!!!!! :>
 
You probably want:

Application.CutCopyMode = False

at the end of the snippet. That kills the marching ants.
 
Worksheets(CStr(Trim(wsSource.Range("A12")) & "
Platform")).Range("I7:N19").Copy
with target.Offset(3, 0)
.PasteSpecial xlPasteValues
..PasteSpecial xlPasteFormats
end with
application.CutCopyMode = False
 
thank you :) Works perfectly :)

Patrick Molloy said:
Worksheets(CStr(Trim(wsSource.Range("A12")) & "
Platform")).Range("I7:N19").Copy
with target.Offset(3, 0)
.PasteSpecial xlPasteValues
.PasteSpecial xlPasteFormats
end with
application.CutCopyMode = False
 
Back
Top