View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Fill cells with names from list

SubCopyNames()
Dim rng as Range, rng1 as Range
set rng = Range("Names")
set rng1 = columns(1).Find(What:="Total Class Hours", _
After:=Range("IV65536"), _
LookIn:=xlConstants, _
LookAt:=xlPart, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)
if rng1 is nothing then
msgbox "Total Class Hours not found"
Exit sub
End if
rng.copy rng1.offset(1,0)
End Sub

--
Regards,
Tom Ogilvy


"David" wrote in message
...
XL2000

I have a workbook I want to use in multiple counties.
I have a list of student names in a named range "Students" in ColAD
ColA contains each students name followed by a list of classes followed by
the words "Total Class Hours"

I know I could do this:
1) Get a list of students from each county
2) Plug it into my existing workbook in ColAD
3) Reassign the named range "Students" to the new list
4) Select a name from the new list
5) Edit Copy
6) Scroll to and select an existing name in ColA
7) Edit PasteSpecial Values (to preserve ColA's formatting)
8) Repeat for each name in the new list

Tedious, right?

I'm hoping a macro could do this:
1) Pick a new name from "Students"
2) Place the name in ColA below the words "Total Class Hours"
3) Repeat for the rest of the new names in "Students"

I know this would bypass the first "old" name. but I could just delete
that
range.

Any help?

--
David