Not using select for copy and paste

  • Thread starter Thread starter damorrison
  • Start date Start date
D

damorrison

Hi,

How could I use this code without the select??

Sheets("Recovered_Sheet1").Select
Range("A10").Select
Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Copy
Sheets("New Format").Select
Range("A2").Select
ActiveSheet.Paste
Application.CutCopyMode = False
 
Maybe...

Dim FirstCell as range
dim LastCell as range
dim RngToCopy as range

with worksheets("recovered_sheet1")
set firstcell = .range("a10")
set lastcell = firstcell.cells.specialcells(xlcelltypelastcell)
set rngtocopy = .range(firstcell,lastcell)
end with

rngtocopy.copy _
destination:=worksheets("new format").range("a2")

application.cutcopymode = false
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top