1: 2: 3:
Sub ChangeDataSource() ActiveSheet.PivotTables("PivotTable1").ChangeConnection ActiveWorkbook.Connections(Range("B5").Value) End Sub