+ Reply to Thread
Results 1 to 3 of 3

Action depending on Listbox Selection

  1. #1
    Registered User
    Join Date
    07-06-2012
    Location
    nh
    MS-Off Ver
    Excel 2003
    Posts
    36

    Action depending on Listbox Selection

    Spreadsheet is attached.

    I have a macro that right now when you click the command button it will prompt you to select a Zip file from a set location and it will extract the excel sheets from that zip file to a folder on the desktop, delete the unwanted spreadsheets, and then clean up a few columns in each remaining spreadsheet.

    I am now trying to add the functionality that will delete certain spreadsheets based on the person selected. For instance If you select User1 and User2 it would delete all spreadsheets except for those that belong to the user(s) selected. Any ideas? I'm new to VBA and am learning as I do it.

    Thank you for your time.


    reporttest.xlsm

  2. #2
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Action depending on Listbox Selection

    Quote Originally Posted by audioboxer View Post
    If you select User1 and User2 it would delete all spreadsheets except for those that belong to the user(s) selected.
    it's not clear for me
    If solved remember to mark Thread as solved

  3. #3
    Registered User
    Join Date
    07-06-2012
    Location
    nh
    MS-Off Ver
    Excel 2003
    Posts
    36

    Re: Action depending on Listbox Selection

    Sorry about that. When this extracts the Zip file there are 114 excel sheets that all have different endings. When a certain user is selected I would like it to delete certain spreadsheets.

    To keep it simple, here is a short example of spreadsheets that are extracted ;

    User1
    NewBiz_BUS121051026.xls
    NewBiz_ESW121051026.xls
    NewBiz_HAM121051026.xls
    User2
    NewBiz_HUB121051026.xls
    NewBiz_MOR121051026.xls
    NewBiz_NKK121051026.xls
    User3
    NewBiz_OMR121051026.xls
    NewBiz_QTK121051026.xls
    NewBiz_RIA121051026.xls

    Lets say user1 is selected I want it to delete sheets that are listed under User2 and User3.

    Right now I just have setup to delete specified excel sheets containing the first three letters.

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    I hope this is more clear.

+ 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