Hi all,
I have some problems with my pivottabel. the first code that have only look in R1C1:R232C12 but when i have data in ROW 233 i will not show in my pivottabel. To fix this with some help off Annette TR we came up with the second code but the whole time i getting errors.
What i'am doing wrong and how can i fix this problem
I have some problems with my pivottabel. the first code that have only look in R1C1:R232C12 but when i have data in ROW 233 i will not show in my pivottabel. To fix this with some help off Annette TR we came up with the second code but the whole time i getting errors.
What i'am doing wrong and how can i fix this problem
Code:
ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatabase, SourceData:= _
"AlarmLog!R1C1:R232C12").CreatePivotTable TableDestination:="", TableName:= _
"pivottabel21", DefaultVersion:=xlPivotTableVersion10
ActiveSheet.PivotTableWizard TableDestination:=ActiveSheet.Cells(3, 1)
ActiveSheet.Cells(3, 1).Select
ActiveWorkbook.ShowPivotTableFieldList = True
Code:
ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatabase, SourceData:=DataRange(Selection.End(xlToRight), Selection.End(xlDown))).CreatePivotTable TableDestination:="", TableName:= _
"PivotTable12", DefaultVersion:=xlPivotTableVersion10
ActiveSheet.PivotTableWizard TableDestination:=ActiveSheet.Cells(3, 1)
ActiveSheet.Cells(3, 1).Select
ActiveWorkbook.ShowPivotTableFieldList = True