Hi all,
I have a workbook that starts blank everytime time its opened, and at the push of a button launches a macro that imports some data, sorts and formats it. All good so far. I am able to create a pivot table (using the wizard) to analyse the data I am left with and display the desired results, but I would like to be able to automate this process, so that the table 'appears' when the original macro has done its work and sorted the data. I have tried (cheating?) recording a macro of the pivot table wizard, but it fails to run and I am not capable of fixing the programing.
Is there an easy way to automate the pivot table process or a macro that can be written that will work?
Here is the code generated by the record macro function
It hangs up at the first 'with' statement, not sure why, but its a simple table, with only the 3 columns of data in it. Any help will be much appreciated,
Cheers,
EDIT: It pays to have a thorough check of all code eh? For whatever reason, when the macro was recorded, it give erroneous array for the source data - once I spotted this and changed it to the correct values, it all works.
Bookmarks