Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 91
Default Not using select for copy and paste

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

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Not using select for copy and paste

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



damorrison wrote:

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


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 91
Default Not using select for copy and paste

Thank you very much

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't Copy and Paste or Paste Special between Excel Workbooks wllee Excel Discussion (Misc queries) 5 April 29th 23 03:43 AM
Select cell, Copy it, Paste it, Return to Previous cell spydor Excel Discussion (Misc queries) 1 December 30th 05 01:29 PM
Excel cut/Paste Problem: Year changes after data is copy and paste Asif Excel Discussion (Misc queries) 2 December 9th 05 05:16 PM
select and paste flow23 Excel Discussion (Misc queries) 1 November 9th 05 05:10 PM
I cannot paste from one workbook to another. Copy works, paste do. JimmyMc Excel Discussion (Misc queries) 1 June 10th 05 03:54 PM


All times are GMT +1. The time now is 02:18 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"