ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro to create workbooks and pivot tables (https://www.excelbanter.com/excel-programming/373177-macro-create-workbooks-pivot-tables.html)

Ciara

Macro to create workbooks and pivot tables
 
I have 2 seperate macro's.
Macro1 -creates a pivot table
Macro2- creates a workbook for each practice.

I would like to combine the two, so that after extracting data needed
to create each workbook I use it as the datasource to create the pivot
table.
Macro2 is based on the example on this website which creates a new
workbook for each value. http://www.rondebruin.nl/copy5.htm#workbook

I need seperate workbooks as it is confidential information... and as I
will be doing this weekly, I would like to have a nice easy macro or
procedure to run, instead of having to create 30 pivot tables. Im sure
this will be easy for someone. Many thanks.


Ron de Bruin

Macro to create workbooks and pivot tables
 
Hi Ciara

You can use the code that create the pivot in my macro

After this line
WBNew.Sheets(1).Columns.AutoFit
You can run your code

You can use the reference WBNew.Sheets(1) in your code to the sheet with the data

Try it and post back if you have problems


--
Regards Ron de Bruin
http://www.rondebruin.nl



"Ciara" wrote in message oups.com...
I have 2 seperate macro's.
Macro1 -creates a pivot table
Macro2- creates a workbook for each practice.

I would like to combine the two, so that after extracting data needed
to create each workbook I use it as the datasource to create the pivot
table.
Macro2 is based on the example on this website which creates a new
workbook for each value. http://www.rondebruin.nl/copy5.htm#workbook

I need seperate workbooks as it is confidential information... and as I
will be doing this weekly, I would like to have a nice easy macro or
procedure to run, instead of having to create 30 pivot tables. Im sure
this will be easy for someone. Many thanks.




Ciara

Macro to create workbooks and pivot tables
 
Sorted! thanks very much. I can't believe how easy that was.

Ron de Bruin wrote:
Hi Ciara

You can use the code that create the pivot in my macro

After this line
WBNew.Sheets(1).Columns.AutoFit
You can run your code

You can use the reference WBNew.Sheets(1) in your code to the sheet with the data

Try it and post back if you have problems


--
Regards Ron de Bruin
http://www.rondebruin.nl



"Ciara" wrote in message oups.com...
I have 2 seperate macro's.
Macro1 -creates a pivot table
Macro2- creates a workbook for each practice.

I would like to combine the two, so that after extracting data needed
to create each workbook I use it as the datasource to create the pivot
table.
Macro2 is based on the example on this website which creates a new
workbook for each value. http://www.rondebruin.nl/copy5.htm#workbook

I need seperate workbooks as it is confidential information... and as I
will be doing this weekly, I would like to have a nice easy macro or
procedure to run, instead of having to create 30 pivot tables. Im sure
this will be easy for someone. Many thanks.




All times are GMT +1. The time now is 11:57 PM.

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