Tharabai
09-22-2015, 04:40 PM
Hi,
When I run a macro, am getting run time error message 1004 in the pivot table wizard as I found only header with data.
if there are no data to put a pivot the results should be displayed as "No results" by inserting a new worksheet.
Below is the code where I get an error message.
Dim objTable As PivotTable, objField As PivotField
ActiveWorkbook.Sheets("Sheet1").Select
Range("A1").Select
Set objTable = Sheets("Sheet1").PivotTableWizard 'Mscro stops here with the error message
With Application
.ScreenUpdating = False
.EnableEvents = False
.Calculation = CalcMode
End With
-Tharabai
When I run a macro, am getting run time error message 1004 in the pivot table wizard as I found only header with data.
if there are no data to put a pivot the results should be displayed as "No results" by inserting a new worksheet.
Below is the code where I get an error message.
Dim objTable As PivotTable, objField As PivotField
ActiveWorkbook.Sheets("Sheet1").Select
Range("A1").Select
Set objTable = Sheets("Sheet1").PivotTableWizard 'Mscro stops here with the error message
With Application
.ScreenUpdating = False
.EnableEvents = False
.Calculation = CalcMode
End With
-Tharabai