Hi.
I need some VBA help to copy data from an excel worksheet to a preformatted excel form, the, save the form to my C drive with the code looped to repeat this sequence for each line of data to be copied.
I have the data set in an excel sheet called "DATA" (below) and the form in same excel workbook in the tab called "Form" (bottom table)
Data sheet - Data starts in Cell B6 (row 5 are headers)
DATA:
What I need is code to copy the data in each row from the Data tab and paste the data into the form below in the tab called "Form" in cells B3, B8, B11, B12, B13, B14. In cell B7 the date needs to be the current date.
FORM:
Once the form has been populated, I need code to then copy only the sheet "Form" to a new excel workbook and save the file on my C drive in folder FORMS/Current with the filename as in the form cell B3 (above it would be the filename Test1)
I then need to loop the code to repeat the process for each line of data in the "Data" tab, so in this instance it would create 5 separate workbooks each with the Form and each with the filename as in cell B3, i.e. Test1, Test2, Test3, Test4 & Test5.
Any help to achieve this would be gratefully received.
Many thanks,
Barry.
I need some VBA help to copy data from an excel worksheet to a preformatted excel form, the, save the form to my C drive with the code looped to repeat this sequence for each line of data to be copied.
I have the data set in an excel sheet called "DATA" (below) and the form in same excel workbook in the tab called "Form" (bottom table)
Data sheet - Data starts in Cell B6 (row 5 are headers)
DATA:
A | B | C | D | E | F | G | |
5 | | Number | Shipping Required Date | Common Name | Destination Addresss | FWDRet Reference | Pick Slip/Move Order Numbers |
6 | | Test 1 | 13/10/2021 | A0135A | TBC address 1 | Ref 1 | M0-123456 M0-123457 |
7 | | Test2 | 31/08/2021 | A0135F | TBC address 1 | Ref 2 | M0-123458 M0-123459 |
8 | | Test3 | 11/10/2021 | A0135J | TBC address 1 | Ref 3 | M0-123460 M0-123461 |
9 | | Test4 | 20/08/2021 | A0202A | TBC address 1 | Ref 4 | M0-123462 M0-123463 M0-123464 |
10 | | Test5 | 16/08/2021 | A0329A | TBC address 1 | Ref 5 | M0-123465 |
What I need is code to copy the data in each row from the Data tab and paste the data into the form below in the tab called "Form" in cells B3, B8, B11, B12, B13, B14. In cell B7 the date needs to be the current date.
FORM:
A | B | ||
1 | |||
2 | |||
3 | Number: | Test1 | |
4 | Senders Name | ||
5 | Telephone Number | ||
6 | |||
7 | Date of Request | Needs to be todays date | |
8 | Shipping Required Date | 13/10/2021 | |
9 | Recipients Name | ||
10 | Telephone Number | ||
11 | Common Name: | A0135A | |
12 | Destination Address | TBC address 1 | |
13 | FwdRet Reference | Ref 1 | |
14 | Pick Slip/Move Order Number | M0-123456 M0-123457 | |
15 | Full Item Description | ||
16 | Individual Item Value | ||
17 | Dimensions in Centimetres | ||
18 | Weight (Kgs) | ||
19 | Do these items contain any information? | ||
20 | Are these Items designed or modified forUse or are they Commercial off the Shelf? | ||
21 | Programme Name/ Cost Code (for billing purposes) | ||
22 | Any specific delivery requirements? (Timed delivery, sameday etc pls note these do incur extra charges) | ||
23 | Signature | ||
24 | Print Name |
Once the form has been populated, I need code to then copy only the sheet "Form" to a new excel workbook and save the file on my C drive in folder FORMS/Current with the filename as in the form cell B3 (above it would be the filename Test1)
I then need to loop the code to repeat the process for each line of data in the "Data" tab, so in this instance it would create 5 separate workbooks each with the Form and each with the filename as in cell B3, i.e. Test1, Test2, Test3, Test4 & Test5.
Any help to achieve this would be gratefully received.
Many thanks,
Barry.