Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Jul 2002
    Location
    Ankeny, Iowa, USA
    Posts
    344
    Thanks
    8
    Thanked 0 Times in 0 Posts

    Delete Excel Files - Macro (Excel 2002)

    Hi,
    I'm wanting to automatically delete the 20 files that are located a particular folder each time I run one of my macros. I need to delete them because new files with the same names will be automatically saved into this folder each time the macro is run. Is their a specific code that would delete the contents of the folder? Below is the part of the macro showing the directory where the 20 files reside.
    Thanks!!
    Lana

    ChDir "G:SharedCatapult OverlaysRaw Material"

  2. #2
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Delete Excel Files - Macro (Excel 2002)

    The following statement will delete ALL of the files in that directory:

    <code>
    Kill "G:SharedCatapult OverlaysRaw Material*.*"
    </code>
    Legare Coleman

  3. #3
    3 Star Lounger
    Join Date
    Jul 2002
    Location
    Ankeny, Iowa, USA
    Posts
    344
    Thanks
    8
    Thanked 0 Times in 0 Posts

    Re: Delete Excel Files - Macro (Excel 2002)

    Awesome! Worked great! Thanks so much Legare!
    Lana

Posting Permissions

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