+ Reply to Thread
Results 1 to 4 of 4

Delete all files in directory, msgbox list files before delete.

  1. #1
    Forum Contributor
    Join Date
    04-03-2009
    Location
    USA, California
    MS-Off Ver
    Excel 2007
    Posts
    385

    Delete all files in directory, msgbox list files before delete.

    I have the below macro that will delete all files in the specified directory. But what i would like to do is before the files are deleted, list the names of all files about to be deleted in a userform with drop down menu. With all items highlighted or selected. Items can be unselected and if they are unselected then they would not be deleted. Once changes to the list of files to be deleted was completed the user will click OK.

    In the event this is not possible how would I simply just use a message to display the files that are about to be deleted with the option to cancel.

    Below is my macro as it is now.

    Please Login or Register  to view this content.
    the other sub mentioned in the above macro.

    Please Login or Register  to view this content.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Delete all files in directory, msgbox list files before delete.

    I'm flabbergasted at how this is any different/easier than simply opening your downloads folder and doing the exact same thing in the Windows Folder using Windows own select/delete processes.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Contributor
    Join Date
    04-03-2009
    Location
    USA, California
    MS-Off Ver
    Excel 2007
    Posts
    385

    Re: Delete all files in directory, msgbox list files before delete.

    Because I always have excel open and I usually want to delete everything when I click this macro which is on the ribbon. But if I don't want to delete everything or change my mind after clicking it I can back out or un-select files. usually I will just click ok and let it delete everything.

    And it is something I don't know how to do in VBA yet. And I would like to see what something like this would look like so I can learn it.

  4. #4
    wilsonjack66
    Guest

    Re: Delete all files in directory, msgbox list files before delete.

    If you have problems deleting long path files, this tool can help you http://www.longpathtool.com

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1