ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Copy variable rows of data to new sheet (https://www.excelbanter.com/excel-programming/358126-copy-variable-rows-data-new-sheet.html)

David Vollmer[_2_]

Copy variable rows of data to new sheet
 
I have to populate two tables in an Access database using the data contained
in several workbooks. The workbooks contain a row of data that will populate
one of the tables (Customers) and one or more adjacent rows that contain the
customer number and at least one account number that will poplulate the
AcctNumb table. Here's an example:

CustName CustNumb Document AccountNumb

Abigail L Smith 990682764 Non-Doc
990682764 100384733
990682764 173550511

The first row will populate the Customer table. The second and third rows
(in this example) will populate the AccountNumb table. The customer numbers
will be the keys in each table.

After I have copied rows two and three to a new sheet I want to delete those
rows in the original sheet . The number of rows of data I will need to copy
for each customer could vary from 1 to 10 or possibly more. Therefore, I need
to be able to vary the number.

I am going to have 8 workbooks that will require a similar operation
utilizing the copy-paste-delete row routine so would like to be able to
modify the code to adapt to the various sheets.

Your help is most appreciated!



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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com