View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
JS SL JS SL is offline
external usenet poster
 
Posts: 49
Default Copy data of records to a templatesheet and save this template aspdf file (and then the other records one by one)

On Monday, May 27, 2019 at 5:09:53 PM UTC+2, JS SL wrote:
Hello, if somebody can help me out :)

I have a sheet with several records which I have to copy to a template sheet and then save/print this sheet as a pdf file on a specific place with a specific name. After the first record the next one has to follow the same rule till the last record.

Sheet1:
Column A exist "Y or N" if this record should be copied to the templatesheet for saving/print as pdf for this specific record.

If Yes in column A; (record 2 till last used);

1a) then.. copy for this specific record the data in Sheet1 ColumnD till Z to sheet2 datafield D4 with a 'transpose' action (you then get the data in Sheet2 in Column D4 till D26).

1b) Then also copy for this specific record the data in Sheet1 Column BB till BD to Sheet2 datafield D30 with a 'transpose' action (you get tje data in sheet2 in Column D30 till D33).

2a) then.. save/print the file as pdf with the filename as mentioned in Sheet1 column B of the same record (could be like 'Template-Blabla' - becomes then 'Template-Blabla.pdf').

2b) The save/print the file should be saved to the directory as mentioned in Sheet1 Column C of the same record (could be like 'C:/Apps/Templates').



After the macro is finished I'd created several pdf files as mentioned in Sheet1 where in Column A the text "Y" is registered.


Hopely explained clear. And hopely somebody to help me out.

regards, Johan


----------------------------------------------------------------

Hello Claus,
Thanks a lot. I shall implement and look if it works well and I can understand it. I allready saw also some other solutions that you answered earlier to other persons regarding 'saving as pdf'. Very nice that you help 'hobby guys' like me :) Thanks !!

In the meantime I had find another issue to solve in this same challange of data :). Perhaps you could give a solution.

In the same row as part of the loop there should follow the action;
1) Select the data in Sheet1 in column B of the active row of the loop.
For example the text is 'AAAA'.
2) Go to Sheet3 and select the data of column A/B/C where the data in column A is the same text as the selected data from Sheet1 column B.
You select then the datacolumns A/B/C where in column A the text is 'AAAA' (filtered on 'AAAA' and selection of the visible parts). Copy this data.
3) Go to Sheet2 and copy the selection to datafield C57.
This all is an action before the printout of the pdf file

regards, Johan