Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Loop for include record from other sheet and then delete old data records

15 views
Skip to first unread message

jm...@xs4all.nl

unread,
Jul 17, 2022, 2:37:07 PM7/17/22
to
Dear All,

Challange for somebody who has a better knowledge then me :)
I've a spreadsheet with Sheet.1 (approx 40.000 records) and Sheet.2 (3 records met formulas)

Sheet.1 Column.A exist of the code "S1, S2, S3 and 0"
The macro has to run from record 2 till last used record.

Required action;
- If Column.A datafield = S1 then copy and include record 5 from Sheet.2 below+1 those S1 record. Then delete the record with S1 and one record under it.
(Example: Record A10 contain 'S1' -> Copy/Include record 5 of Sheet.2 under record 10+1=11 means Copy/Include as record 12. Then delete record 10 and 11)

- If Column.A datafield = S2 then copy and include record 6 from Sheet.2 below+2 those S2 record. Then delete the record with S2 and two records under it.
(Example: Record A10 contain 'S2' -> Copy/Include record 6 of Sheet.2 under record 10+2=12 means Copy/Include as record 13. Then delete record 10, 11 and 12).

- If Column.A datafield = S3 then copy and include record 7 from Sheet.2 below+3 those S3 record. Then delete the record with S3 and three records under it.
(Example: Record A10 contain 'S3' -> Copy/Include record 7 of Sheet.2 under record 10+3=13 means Copy/Include as record 14. Then delete record 10,11,12 and 13).

- If Column.A datafield = 0 then no action.

Should be nice if somebody can help me out.
thnx a lot !!

Regards, Johan
0 new messages