Amir Wisal
New Member
Hi All,
I am new to VBA and need to split a workbook in such a way that it take the first two sheets and make it a new workbook, save it to a desired folder and also save a PDF version of the new workbook created (obviously by taking the first two sheets).
My workbook has variable number of sheets but it will always comes in pairs (2 each). I want to have a dynamic vba code which will loop through the workbook and split the first two sheets, save it in excel as well PDF and then go the third and fourth sheet, save it in excel and PDF as well and so on.
I have recorded a macro for it but as you'll be aware that Macro it static and i want it to be dynamic - meaning to loop through the whole workbook. Further, it would be great if the saved excel and PDF will rename itself based on the first sheet of each pair. Hope i am clear with the instructions but if further details are required, please do let me know.
The macro that i have recorded is saved in the attached excel spreadsheet.
Thank you All in advance.
I am new to VBA and need to split a workbook in such a way that it take the first two sheets and make it a new workbook, save it to a desired folder and also save a PDF version of the new workbook created (obviously by taking the first two sheets).
My workbook has variable number of sheets but it will always comes in pairs (2 each). I want to have a dynamic vba code which will loop through the workbook and split the first two sheets, save it in excel as well PDF and then go the third and fourth sheet, save it in excel and PDF as well and so on.
I have recorded a macro for it but as you'll be aware that Macro it static and i want it to be dynamic - meaning to loop through the whole workbook. Further, it would be great if the saved excel and PDF will rename itself based on the first sheet of each pair. Hope i am clear with the instructions but if further details are required, please do let me know.
The macro that i have recorded is saved in the attached excel spreadsheet.
Thank you All in advance.