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: 55
Default Copy a by macro special selected nr of rows into another file


As part of a complex process of actions, there is a new part where I can use some help. I think it's easy if you knows the correct code :) (as Always).


File1/Sheet1:
contains a heading in row 1 and several data in records row 2 till last, whereby in column A for some records the data in it is the same and those who are the same are always sorted by each other.

Example:
1. Heading
2. AAA
3. AAA
4. AAA
5. BBB
6. BBB
7. CCC
8. DDD
9. DDD

When run the macro the required action is;
Step1:
1a) For the active cell (standing at that moment) look at the data in the active record in column A and select then all the complete rows were in column A the data is the same.
1b) Copy all the selected records.
1c) Keep in memory the active file/sheet name.

(This means when I run the macro and the active cell is D3, the macro select then the complete rows 2+3+4 because they have the same data in column A. Then it selects all this rows and keep in mind the name File1/Sheet1).

File1/Sheet2:
This contains in datafield A2 the reference to a file.
For example c:/Apps/import.xls

Step2:
2a) The macro should open the file as mentioned in File1/Sheet2 field A2 (then you opens File2/Sheet1).
2b) Then in this opened file delete all the records in it from row2 till last.
2c) Then copy the selected records from step1b of File1/Sheet1 into row2 etc of this File2/Sheet1.
2d) Save/Close the file File2.

Step3:
In the selected records of File1/Sheet1 set in all those records in column B the actual date of this copy action.

If somebody can help me out, thanks.

regards,
Johan


 
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
Macro to copy & paste-special-values data to selected worksheets tomhelle Excel Discussion (Misc queries) 1 May 5th 10 02:00 PM
Special Copy, Paste Special macro usmc-r70 Excel Programming 3 July 2nd 09 08:12 AM
macro to copy rows and paste-special to another workbook Nitin Excel Programming 0 May 15th 08 07:40 PM
Macro to copy and paste a user selected number of rows bozwero Excel Programming 2 November 29th 06 11:32 AM
Macro to copy and past selected rows only... Jules[_4_] Excel Programming 1 April 14th 04 02:31 PM


All times are GMT +1. The time now is 10:27 AM.

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"