ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   how to reference selected cells in SourceData (https://www.excelbanter.com/excel-programming/424747-how-reference-selected-cells-sourcedata.html)

ed

how to reference selected cells in SourceData
 
How do I change the code at the bottom to reference all the selected
cells in the source table/ The number of cells changes every time.

In other words what syntax replaces R1C6:R392C8? to reference the
selected cells whatever they may be?

I am obviously not at all proficient in this endeavor. Thanks

================================================== =======
ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatab ase, SourceData:= _
"rents!R1C6:R392C8")
================================================== =======

Lonnie M.

how to reference selected cells in SourceData
 
Ed, take a look at "PivotTableWizard" in the VBA help.

HTH—Lonnie M.


All times are GMT +1. The time now is 08:29 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com