Consulting

Results 1 to 4 of 4

Thread: Code to Filter, Copy, Paste and Save Data

  1. #1

    Code to Filter, Copy, Paste and Save Data

    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!

  2. #2
    VBAX Mentor MaximS's Avatar
    Joined
    Sep 2008
    Location
    Stoke-On-Trent
    Posts
    360
    Location
    Can you please post sample workbook with some date before and after?

  3. #3
    I've not been asked to do that before - is there a way to upload a small Excel file or can I just paste in a screen shot?

  4. #4
    VBAX Mentor MaximS's Avatar
    Joined
    Sep 2008
    Location
    Stoke-On-Trent
    Posts
    360
    Location
    Of course there is a way to do it - instead of 'Post Quick Reply' use 'Go Advanced' where you will find attachment management.

    Without the sample file its hard to imagine how you data structure looks like, what do you need to filter, etc.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •