View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Stefi Stefi is offline
external usenet poster
 
Posts: 2,646
Default Extract a list from master list

Try this event macro:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$F$2" Then
Application.EnableEvents = False
Application.ScreenUpdating = False
columnheaderG = Range("G1").Value
Range("A:B").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:=Range("F2").Value
Selection.CurrentRegion.Select
Range("B:B").SpecialCells(xlCellTypeVisible).Selec t
Range("G:G").ClearContents
Selection.Copy Destination:=Range("G1")
Selection.AutoFilter
Range("G1").Value = columnheaderG
Range("F2").Select
Application.ScreenUpdating = True
Application.EnableEvents = True
End If
End Sub

Additionally you can create a Data Validation list for F2.

Regards,
Stefi


js ezt *rta:

Hi,
I have master list (B3:C8) and I'd like to display a list (G3:G4) based on
cell F3. How I could do that?
Thank you.

Column B Column C Column F Column G
Row 3 Fruit Apple Vegetable Cabbage
Row 4 Vegetable Cabbage Broccoli
Row 5 Fruit Grape Spinach
Row 6 Vegetable Broccoli
Row 7 Vegetable Spinach
Row 8 Fruit Orange