Hello,
I have a front sheet with a bunch of validation-list-drop-downs. When the user selects combinations of these and then runs a macro, a table on the second sheet is filtered by those criteria. Each row has a unique ID, let's called it the Sweet ID.
There is another third sheet which has more data (one row per Sweet ID, but with a different bunch of columns).
Here's what I would like to do: Run the macro which filters the second sheet, takes those Sweet IDs and then uses those to fitler the third sheet.
Grateful for any help. Thanks,
HE.
Last edited by headexperiment; 08-22-2011 at 12:02 PM. Reason: Solved
Just to clarify - I already have the first bit sorted which filters the second sheet. It's the final step I need help with. Thanks.
Bump. Grateful for any help the experts can offer. Thanks.
hi, headexperiment, is there any chance to see a sample workbook showing original data and result you need to obtain?
Hello,
I've anonymised the workbook I'm working on. Grateful for any help. To recap- I want to take the Sweet IDs left after filtering the List sheet, and use those IDs to filter the M sheet.
Thanks,
HE
please check attachment, run code "test"
Hi HE
Try this codeLet me know of issues.Option Explicit Sub Test() Dim LR As Long Dim LRm As Long Dim LRf As Long Application.DisplayAlerts = False Sheets("Fdata").Delete Application.DisplayAlerts = True Worksheets.Add(After:=Worksheets(Worksheets.Count)).Name = "Fdata" With Sheets("List") LR = .Range("A" & .Rows.Count).End(xlUp).Row .Range("A11:A" & LR).SpecialCells(xlCellTypeVisible).Copy Sheets("Fdata").Range("A1").PasteSpecial Application.CutCopyMode = False End With LRf = Sheets("Fdata").Range("A" & Rows.Count).End(xlUp).Row With Sheets("M") .AutoFilterMode = False LRm = .Range("A" & .Rows.Count).End(xlUp).Row .Range("A9:A" & LRm).AdvancedFilter Action:=xlFilterInPlace, CriteriaRange:= _ Sheets("Fdata").Range("A1:A" & LRf), Unique:=False .Activate End With End Sub
Last edited by jaslake; 08-18-2011 at 04:27 PM. Reason: Attach File
John
If you have issues with Code I've provided, I appreciate your feedback.
In the event Code provided resolves your issue, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.
If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.
Hi HE
Hope you don't mind...I've rewritten the code for your "Reset All" button. If you like it use it...if not lose itSub showall() Dim Rng As Range With Sheets("Front") On Error Resume Next Set Rng = Union([Option_att_flag], [Option_prog_flag], [Option_proj_flag], [Option_pp_flag], _ [Option_20plus_flag], [Option_10plus_flag], [Option_5plus_flag], [Option_age], [Option_type], [Option_ccc]) Rng.Value = "Any" On Error GoTo 0 End With With Sheets("List") If .FilterMode Then .ShowAllData End If End With With Sheets("M") If .FilterMode Then .ShowAllData End If End With End Sub
John
If you have issues with Code I've provided, I appreciate your feedback.
In the event Code provided resolves your issue, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.
If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.
Hi Jaslake and Watersev,
Apologies didn't get back to you lastw week. Many thanks for your help looking into this. I'll have a play and let you know what I find.
Thanks,
HE
@Jaslake
on error resume next Sheets(array("List","M")).showalldata
Thanks John,
Seems to work ok. Must confess I don't understand the intricacies of whether the code lives in ThisWorkbook or in a module, but is it possible to combine the new test() code with the existing filtersheets() code, so it all works together?
Cheers, HE
Big thanks to @jaslake and @watersev. With a bit of tweaking I've got this doing exactly what I want.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks