+ Reply to Thread
Results 1 to 2 of 2

Find and delete files

  1. #1
    Registered User
    Join Date
    09-21-2011
    Location
    Brasil
    MS-Off Ver
    Excel 2003
    Posts
    15

    Find and delete files

    Hello
    Much as I have tried and tried I can not solve this problem
    I need a macro that runs in a excel file and look in the folder ORDERS and folder BUDGET for files exactly the same as the one I have open and delete files that have the same name in those folders. The file is never the same as it is recorded with a number automatically.

    Someone help me? Pleaseeeeeeee

    Patricia

  2. #2
    Forum Contributor
    Join Date
    06-07-2011
    Location
    Hnd
    MS-Off Ver
    Excel 2010
    Posts
    161

    Re: Find and delete files

    Oi Patricia,

    An option could be create a macro that will be available for any workbook opened.

    Assuming the file you open is in a different folder of ORDERS or BUDGET, proceed as follow:

    Create a personal.xlsb book (Personal macro book) doing:

    * After create the personal macro book, you'll see the file PERSONAL.XLSB created in C:\Users\<username>\AppData\Roaming\Microsoft\Excel\XLSTART if you have Windows 7 or Vista.

    For more details on Personal.xlsb see this:
    http://office.microsoft.com/en-us/ex...102174076.aspx


    1-) Record a macro, in the window that appears select to save the macro not in current workbook, but in "Personal Macro workbook"
    2-) Do some actions and stop the recording.
    3-) Open VB editor (Alt + F11), now you'll see on the left pane a new VBAProject(PERSONAL.XSLB).
    4-) Then, in the macro you just recorded, replace its code by the code below and save changes (Ctrl+S within code editor)
    5-) Change the real path in the lines in red and save changes again.
    6-) Close Excel completely (all workbooks and Excel Application)
    7-) Test it! opening a file you think is in folders ORDERS or BUDGET and to execute the macro press the shortcut, Ctrl+Shift+B.
    Please Login or Register  to view this content.
    Hope it works and helps to you.

    Regards
    Last edited by cgkmal; 10-12-2011 at 06:23 PM.

+ 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