Hello,

I am trying to use the following code to highlight all cells w/ data in my worksheet, and then use the highlighted cells as a datasource for my Pivot Table, but can't figure out how to point "SrcData = ..." line to a dynamic range... Please help.

Thanks!


Dim PvtRng As Range

Range("A1").Select

Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select

PvtRng = ActiveSheet.Selection

SrcData = ActiveSheet.Sheet1 & "!" & PvtRng.Select.Address(ReferenceStyle:=xlR1C1)
[