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: 60
Default Copy problem again.

ManualMan very kindly suggested the script below to enable me to copy
data from cell AT1 of Sheet 1 and paste it to cell A2 of Sheet 2. What
I've been trying to do today, with no success at all, is when when I
do the exercise again, I need to copy from Sheet2 AT1 but now copy to
Sheet1 A3 etc.

Dim x As Long
'lets start at row 2
x = 2

'pasting Sheet2!AT1(AIR NO) to Sheet1!A2
Worksheets("Sheet1").Cells(x, 1).Value =
Worksheets("Sheet2").Cells(1, 46).Value

I've tried to get x to increment each time, I've also tried the
following:

Dim x As Long
'lets start at row 2
x = Application.WorksheetFunction.CountA(Range("A:A")) + 1

'pasting Sheet2!AT1(AIR NO) to Sheet1!A2
Worksheets("Sheet1").Cells(x, 1).Value =
Worksheets("Sheet2").Cells(1, 46).Value

But this insists on writing to row A1, which already has data in it.

I the script to find the next empty cell in column A and write to that
each time i.e. A2 then A3 the A4 etc.

I've also tried, unsuccessfully, to make x equal to a value in another
cell in the worksheet that has the following formula in it:

=COUNT(A2:A10)+2

I had hoped that because this increments each time a row is used, that
it would force the entry to the next free row, but no joy.

Any help/advice/suggestions would be much appreciated.


--
Cheers

Peter

Remove the INVALID to 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
V-Look up copy problem-PLEASE HELP Sekhar Excel Worksheet Functions 3 September 12th 08 09:56 AM
copy problem WTG Excel Worksheet Functions 2 March 23rd 07 09:50 PM
Copy Problem [email protected] Excel Discussion (Misc queries) 6 August 11th 05 12:45 AM
Help please with copy problem Peter[_28_] Excel Programming 2 November 3rd 04 09:51 PM
copy problem Mark K[_3_] Excel Programming 2 February 26th 04 06:11 PM


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