I tried making a macro would would basically condense the drilldown of a Pivot Table by only copying out certain columns that I would want.
this has work quite well, but I was wondering if I can make this a little more dynamic so that I can easily apply this to future Pivot Tables. That is, if I were to put my search term on ARO Pivot Table Extractor 1.0.xls's Sheet1's Cell A1, can I then get the macro to just do a search of the string in that cell on my other worksheet? (in this case it would do a search of cell A1 on the other active workbook and return th response in Extractor's Data Sheet in Column A)
Thanks in advance
Sam
Code:
Currentfile = ActiveWorkbook.Name
Extractor = "ARO Pivot Table Extractor 1.0.xls"
Windows(Currentfile).Activate
Range("A1").Select
Dim Found As Range
Set Found = Cells.find(What:="Outlet #", After:=ActiveCell, LookIn:=xlValues, _
LookAt:=xlWhole, SearchOrder:=xlByColumns, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False)
If Not Found Is Nothing Then Range(Found, Found.End(xlDown).Offset(2000, 0)).Select
Selection.Copy
Windows(Extractor).Activate
Sheets("Data").Select
Range("A1").Select
ActiveSheet.Paste
this has work quite well, but I was wondering if I can make this a little more dynamic so that I can easily apply this to future Pivot Tables. That is, if I were to put my search term on ARO Pivot Table Extractor 1.0.xls's Sheet1's Cell A1, can I then get the macro to just do a search of the string in that cell on my other worksheet? (in this case it would do a search of cell A1 on the other active workbook and return th response in Extractor's Data Sheet in Column A)
Thanks in advance
Sam