Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a list with several columns:
PARENT CHILD PHONE AGE NOTES... I would like a dropdown with the parents listed one time, that would select all their children and show the related information. I would like a second dropdown with just their children listed so I can pick the data from just that child. 1. I'm stumped on populating the first dropdown, listing the parents only one time. 2. I think there should be a much better way then this code to select the duplicate parents. Sub pick() ' ' pick Macro ' Macro recorded 11/22/03 by James' ' MyData has the Parent's name Sheets("Sheet2").Select Range("e2").Select MyData = ActiveCell.Text ' Col A has Parent's name, Col B has the Child's name Sheets("Sheet1").Select Range("a1").Select ' Sort data to group parents Application.Goto Reference:="Sample" Selection.Sort Key1:=Range("A2"), Order1:=xlAscending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom Range("A1").Select 'Find 1st incident of Parent Do While ActiveCell.Text < MyData ActiveCell.Offset(1, 0).Select Loop Set first = ActiveCell ' Find last incident of Parent Do While ActiveCell.Text = MyData ActiveCell.Offset(1, 0).Select Loop ActiveCell.Offset(-1, 15).Select Set last = ActiveCell Range(first, last).Select Selection.Copy Sheets("Sheet2").Select Range("A10").Select ActiveSheet.Paste Range("A10").Select End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Working with Lists (Now Tables) in Excel 2007 | Excel Discussion (Misc queries) | |||
Working with lists | Excel Discussion (Misc queries) | |||
Protection with working dropdown lists. | Excel Discussion (Misc queries) | |||
working with funcions in filtered lists | Excel Discussion (Misc queries) | |||
Working with Lists in Excel 2003 | Excel Worksheet Functions |