+ Reply to Thread
Results 1 to 5 of 5

Filter from separate worksheet

  1. #1
    Registered User
    Join Date
    01-31-2008
    Posts
    4

    Filter from separate worksheet

    I have a "Master" worksheet with all the data.
    I would like to have separate worksheets that displays all of the fields for all of the records with a matching "Location"

    ie, worksheet named "loc1" will have all records matching "loc1" field from the Master, and a worksheet named "loc2" ...etc

    I could also deal with a "Key Cell" on a worksheet where I would either enter "loc1", or have a pull-down listing all loc#s that would be a trigger to populate the sheet.

    Updates will be to the Master sheet only.
    A "refresh" button would be acceptable for the loc# worksheets.

    It seems I can't relocate the filter results to a different worksheet. Is there a work around?
    I don't want to AutoFilter the Master and then copy-paste to the loc# sheet.

    Thanks

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,523
    Here's an updated version of Filter Vegies workbook http://www.excelforum.com/showthread.php?t=592750

    This new version uses the worksheet_change event, so use the dropdown menu(Blue cell) in sheet 3 and select an Item, it filters the data you selected from sheet 2, and copies it to sheet 3
    Right click on the button and select assign macro, then select the edit button, now you should be in vba and where the filter code is displayed
    The code to filter is:
    Please Login or Register  to view this content.
    You will see in the code this
    Please Login or Register  to view this content.
    that calls a macro to copy the filtered data and paste it into Sheet3
    That code was originally acquired from contextures.com :

    Please Login or Register  to view this content.
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    01-31-2008
    Posts
    4
    This looks great!

    Thanks!

  4. #4
    Registered User
    Join Date
    01-31-2008
    Posts
    4

    Protection Copied

    The code worked great!
    I now have a Master sheet of all the data, and a "Site" sheet that will display the records matching the locID from a pull-down, after a button push.

    Now, in trying to protect this sheet from flailing fingers, and to impress that Updates should be on the Master only, I've inserted a few "ActiveSheet.Protect" and ".Unprotect" statements.

    I do have some formulas on the Master that I want to preserve, so I protected the sheet and unlocked most of the other cells.

    Now when the macro runs to update the 'Site' sheet, the "unlocked" property is copied from the Master to the Site cells.

    Is there a setting or switch that will keep the whole "Site" sheet protected?
    Or a tweak in the "copy" code?

    Thanks

  5. #5
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    See link.

    http://www.ozgrid.com/VBA/excel-macr...cted-sheet.htm

    Can either use something like

    Please Login or Register  to view this content.
    or see UserInterfaceOnly

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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