Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

selecting all data

Status
Not open for further replies.

mtdew

Technical User
Dec 9, 2007
77
US
I copy data from several sheets to one sheet and use that data to create pivot tables. When I record the macro to create the pivot table I go to the sheet with all the data and use Ctrl+Shift+A to select all the data on the sheet for the pivot table. But, as sheets are added to the Excel file, when the macro for the pivot table is run it only collects data that was there when I created the macro and nothing that was added since that time.

ActiveWorkbook.Worksheets("Reports").PivotTables("PivotTable1").PivotCache. _
CreatePivotTable TableDestination:="Reports!R1C4", TableName:="PivotTable3" _
, DefaultVersion:=xlPivotTableVersion12
Sheets("Reports").Select
Cells(1, 4).Select

How can I tell the macro to select everything on the sheet when the data grows?
 


Hi,

This code is only related to the report sheet. Has no reference to any other sheet.

???


Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top