LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default Copy cells in another worksheet without activating

I have a macro that copies cells from another worksheet in a loop. The
macro switches between sheets many times while the macro is runnin
because I am activating one sheet, then copying to another. How can I
copy cells in another worksheet without first activating it? Here is
the loop that I am now using:

If Not c Is Nothing Then
firstAddress = c.Address
Do

Sheets("Files").Activate
range(c.Address).Select
Selection.Resize(1, 6).Select
Selection.Offset(0, -2).Select
Selection.Copy
Set rng = Sheets("Directory").Cells(Rows.count,
2).End(xlUp)(2).Offset(0, -1)
rng.PasteSpecial xlValues
Set c = .FindNext(c)

Loop While Not c Is Nothing And c.Address < firstAddress
End If

I tried using Sheets("Files").range(c.Address).Select but I get a
"select method of range class failed" error. Anyone got any ideas?
Thanks.

 
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
Activating a Worksheet? Kenny R Excel Discussion (Misc queries) 3 December 8th 06 05:15 PM
Worksheet activating JamesM[_2_] Excel Programming 0 September 28th 04 04:34 PM
Worksheet activating JamesM Excel Programming 0 September 28th 04 03:55 PM
Activating a worksheet DJH Excel Programming 2 August 10th 04 04:20 PM
Copy one spreadsheet into another without activating second spreadsheet's user form P Cheek Excel Programming 3 July 23rd 03 06:26 PM


All times are GMT +1. The time now is 07:03 PM.

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

About Us

"It's about Microsoft Excel"