pliskers
08-11-2009, 07:30 PM
I have a file with two tabs: One contains a list of Cost Centers (call it "List"), and another containing cost data (call it "Data").
I need code that will run a loop to sequentially, for each Cost Center in the list:
1) Filter the data in the "Data" tab on a cost center field set to the Cost Center's number,
2) Copy the filtered data
3) Open a new Excel file and paste the data into cell A1,
4) Save the new file with the Cost Center in the file name and then close the file, and then
5) Go back to the Cost Center "List" tab and perform the same sequence on the next item in the list, until there is a file saved with the data filtered for each cost center.
I have a general idea, but am only moderately familiar modifying code, so would appreciate some help with this ASAP.
Thanks in advance for anyone's assistance!
I need code that will run a loop to sequentially, for each Cost Center in the list:
1) Filter the data in the "Data" tab on a cost center field set to the Cost Center's number,
2) Copy the filtered data
3) Open a new Excel file and paste the data into cell A1,
4) Save the new file with the Cost Center in the file name and then close the file, and then
5) Go back to the Cost Center "List" tab and perform the same sequence on the next item in the list, until there is a file saved with the data filtered for each cost center.
I have a general idea, but am only moderately familiar modifying code, so would appreciate some help with this ASAP.
Thanks in advance for anyone's assistance!