Hi,
I'm trying to simply create a pivot table using VBA. However, the number of rows is unknown and changes each time the program is run. To counter this, so that my macro selects the entire dataset, I've been attempting to set my range equal to a variable and then plugging the variable into the SourceData.
my headings are in Ranges(A1:E1), so I've been selecting A1, end(xlright) to select all the columns, then end(xldown) to select all the rows. Then setting the selection equal to the variable pivotrange. below is a snip of my code.
I'm about to throw my laptop out the window... so I would really appreciate any help you can offer.
Please Login or Register to view this content.
Bookmarks