Hi Enbentro,
Can anyone see what I may have altered so as to make macro unusable? I wish
I could remember!
All I can see quickly, is that your code will fail with sheetnames that contain
spaces in them. This line of code:
ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatab ase, SourceData:= _
ActiveSheet.Name & "!r1c1:r170c4").CreatePivotTable
needs to be changed to:
ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatab ase, SourceData:= _
"'" & ActiveSheet.Name & "'!r1c1:r170c4").CreatePivotTable
Regards,
Jan Karel Pieterse
Excel MVP
http://www.jkp-ads.com