Is there a quick way to create a VBA function. I have this VBA function to create Pivot table in excel, but I want to
1) Create an Excel and trasnport data in excel (using DDE)
2) Once data has been passed to excel I want to create this VBA code on the fly to create Pivot table.
Can this be done ? i.e. Writing a sub routine or function code on the fly and asking excel to run that function or sub ?