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: 11
Default Specifying Range.Select in a loop

I need to do something equivalent to the example below - primarily copy from
a nominated cell in one Workbook and paste to a specific cell in another.

However the cell that I copy from will vary with each pass through the loop
- how can I specify the Range (??).Select?

' Count the number of rows in the column
' Choose the worksheet - need to put the accound worksheet name here
Worksheets("Super").Activate

' Select the column
Range("A5").Select

' Select all rows in column
Range(Selection, Selection.End(xlDown)).Select

For i = 1 To Selection.Rows.Count
Range("A"+i).Select ' in workbook one
Selection.Copy
Range("D4").Select ' in Workbook two
ActiveSheet.Paste
Next i
 
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
Compare a selected Range with a Named range and select cells that do not exist PCLIVE Excel Programming 1 October 18th 05 07:09 PM
How to select columns in loop Tom Ogilvy Excel Programming 1 January 18th 05 05:53 PM
How to select columns in loop Bob Phillips[_7_] Excel Programming 0 January 18th 05 04:10 PM
Select Sheet then Select Range Gee[_2_] Excel Programming 3 May 27th 04 10:10 PM
select column cell in same row as loop result? john_t_h[_7_] Excel Programming 8 January 14th 04 06:21 AM


All times are GMT +1. The time now is 12:48 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"