J
JSnader
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
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