Sub tabla_dinamica()
Dim rango_datos As String
Sheets("Datos").Select
Range("A1").Select
ActiveSheet.Paste
Sheets("Datos").Select
Range("A1").Select
Selection.End(xlUp).Select
Selection.End(xlToRight).Select
rango_datos = Replace("Datos!R1C1:R" + Str(ActiveSheet.UsedRange.Row - 1 + ActiveSheet.UsedRange.Rows.Count) + "C" + Str(ActiveCell.Column), " ", "")
ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
rango_datos, Version:=xlPivotTableVersion10).CreatePivotTable _
TableDestination:="Tabla!R3C1", TableName:="Tabla dinámica1", _
DefaultVersion:=xlPivotTableVersion10
Sheets("Tabla").Select
Cells(3, 1).Select
End Sub
Que buen aporte, me sirve mucho ..
ResponderEliminarat.
andres mosquera