+ Reply to Thread
Results 1 to 7 of 7

Delete all files listed in Column A

  1. #1
    Registered User
    Join Date
    01-30-2015
    Location
    California, USA
    MS-Off Ver
    2003, 2007, 2010 & 2013
    Posts
    20

    Delete all files listed in Column A

    Hello,

    I have been looking, and tried a few scripts, all seem to not work.

    i tried the following code below, it doesn't work if the file name has spaces i'm guessing, but it also doesn't really tell me what it is doing ha, just my guess based off a few test files. Any help would be appreciated. i have about 42k files that were hit with a crypto virus that i need to delete.


    Please Login or Register  to view this content.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2404
    Posts
    24,776

    Re: Delete all files listed in Column A

    What strings are in columns A and B? Can you give one or two examples? That might be your problem. Spaces in the file names will not cause a problem the way this is written.

    Excel VBA is a kind of an oddball way to solve this. You could use this list of files to generate a Windows .bat file and run that.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    01-30-2015
    Location
    California, USA
    MS-Off Ver
    2003, 2007, 2010 & 2013
    Posts
    20
    Quote Originally Posted by 6StringJazzer View Post
    What strings are in columns A and B? Can you give one or two examples? That might be your problem. Spaces in the file names will not cause a problem the way this is written.

    Excel VBA is a kind of an oddball way to solve this. You could use this list of files to generate a Windows .bat file and run that.
    It doesnt have to be excel, just what im used to. Hiw would the .bat file be written?

    The data in A is literally the entire path & filename.ext

  4. #4
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: Delete all files listed in Column A

    May be the files some kind of virus and this is the cause of problem
    But as for the code provided in your post, it is working well

    Put the path in column A starting in row 2 like that
    Please Login or Register  to view this content.
    this is an example

    and in column B put the file name with extension for example : Test.txt
    < ----- Please click the little star * next to add reputation if my post helps you
    Visit Forum : From Here

  5. #5
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2404
    Posts
    24,776

    Re: Delete all files listed in Column A

    Quote Originally Posted by mkn95u0 View Post
    The data in A is literally the entire path & filename.ext
    Then what is in column B that you are appending to it?

    If you're comfortable with VBA no reason not to do it, especially since you have the list of filenames in Excel. You're almost there.

  6. #6
    Registered User
    Join Date
    01-30-2015
    Location
    California, USA
    MS-Off Ver
    2003, 2007, 2010 & 2013
    Posts
    20

    Re: Delete all files listed in Column A

    Quote Originally Posted by 6StringJazzer View Post
    Then what is in column B that you are appending to it?

    If you're comfortable with VBA no reason not to do it, especially since you have the list of filenames in Excel. You're almost there.
    nothing. it's like this:

    Please Login or Register  to view this content.
    this script worked for about 280 files, after that, just doesn't do anything. all of them are the same format, just different paths

  7. #7
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2404
    Posts
    24,776

    Re: Delete all files listed in Column A

    It might help to put some diagnostics into the code, since we can't test it with your files. This will write information into column C for each file. See changes in red.
    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 4
    Last Post: 03-31-2015, 11:40 AM
  2. Delete row (row# to delete is listed on spreadsheet)
    By acroley1 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-02-2015, 11:17 AM
  3. Add Hyperlink to listed Files
    By Brawnystaff in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-24-2014, 01:20 PM
  4. Replies: 2
    Last Post: 02-07-2014, 05:38 PM
  5. [SOLVED] Trying to move listed name of files to new path using VBA...not working :(
    By draconius in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-20-2013, 01:59 PM
  6. Noob 4 Help - Macro to LIST ALL FILES IN FOLDER and then IMPORT ALL LISTED FILES
    By StlSmiln in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-25-2012, 04:02 AM
  7. Delete rows listed less than 8 times???
    By anilos81 in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 11-10-2005, 12:29 PM

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