Te envié la macro.
Recuerda valorar la respuesta.
Sub tablad()
'Por.DAM
'
Application.ScreenUpdating = False
u = Range("A" & Rows.Count).End(xlUp).Row
ActiveSheet.Columns("Z:AD").Delete Shift:=xlToLeft
ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, _
SourceData:=Range("A4:V" & u), _
Version:=xlPivotTableVersion12). _
CreatePivotTable _
TableDestination:=Range("Z9"), _
TableName:="Tabla dinámica6", _
DefaultVersion:=xlPivotTableVersion12
With ActiveSheet.PivotTables("Tabla dinámica6")
.PivotFields("Type").Orientation = xlPageField
.PivotFields("Type").Position = 1
.PivotFields("Pozo").Orientation = xlRowField
.PivotFields("Pozo").Position = 1
.PivotFields("BHA No.").Orientation = xlRowField
.PivotFields("BHA No.").Position = 2
.PivotFields("Assembly name").Orientation = xlRowField
.PivotFields("Assembly name").Position = 3
.AddDataField ActiveSheet.PivotTables _
("Tabla dinámica6").PivotFields("Length (ft)"), "Suma de Length (ft)", xlSum
.AddDataField ActiveSheet.PivotTables _
("Tabla dinámica6").PivotFields("MD out (ft)"), "Suma de MD out (ft)", xlSum
.InGridDropZones = True
.RowAxisLayout xlTabularRow
End With
End Sub