Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Copy names to another sheet

I have a list of data in a sheet named Official List. This list is
added to each day. 1 of the columns on this list shows a name of a
person. These persons show up multiple times on the list.
What I want to do is to copy each name once from this list in Official
List to another sheet named Contact List. I’ve poked around in past
posts, and couldn’t find anything close enough for me to play around
with.
I know how to copy & paste data via macro. What I don’t know is how to
make it compare the text in the cell vs the list in Contact List to
see if that name is on the list already.

I’m think of something along these lines…..

Goto Contacts (named range of column header in Official List sheet)
Down 1

Do until isempty

Read 1st cell
If cell = name from list in sheet Contact List (name already on the
list)
Then move down 1 cell
Next
Else copy that name to list.

This would loop until the 1st empty cell is found.

As always, I appreciate your help.
Thanks
jeff
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Copy names to another sheet

Person = "John"
set c = Range("Contact
List").find(what:=Person,lookin:=xlvalues,lookat:= xlwhole)
if c is nothing then
'enter code here
else
'enter more code here
end if

" wrote:

I have a list of data in a sheet named Official List. This list is
added to each day. 1 of the columns on this list shows a name of a
person. These persons show up multiple times on the list.
What I want to do is to copy each name once from this list in Official
List to another sheet named Contact List. Ive poked around in past
posts, and couldnt find anything close enough for me to play around
with.
I know how to copy & paste data via macro. What I dont know is how to
make it compare the text in the cell vs the list in Contact List to
see if that name is on the list already.

Im think of something along these lines€¦..

Goto Contacts (named range of column header in Official List sheet)
Down 1

Do until isempty

Read 1st cell
If cell = name from list in sheet Contact List (name already on the
list)
Then move down 1 cell
Next
Else copy that name to list.

This would loop until the 1st empty cell is found.

As always, I appreciate your help.
Thanks
jeff

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Copy names to another sheet

On Oct 10, 11:46*am, Joel wrote:
Person = "John"
set c = Range("Contact
List").find(what:=Person,lookin:=xlvalues,lookat:= xlwhole)
if c is nothing then
* *'enter code here
else
* *'enter more code here
end if



" wrote:
I have a list of data in a sheet named Official List. This list is
added to each day. 1 of the columns on this list shows a name of a
person. These persons show up multiple times on the list.
What I want to do is to copy each name once from this list in Official
List to another sheet named Contact List. I’ve poked around in past
posts, and couldn’t find anything close enough for me to play around
with.
I know how to copy & paste data via macro. What I don’t know is how to
make it compare the text in the cell vs the list in Contact List to
see if that name is on the list already.


I’m think of something along these lines…..


Goto Contacts (named range of column header in Official List sheet)
Down 1


Do until isempty


Read 1st cell
If cell = name from list in sheet Contact List (name already on the
list)
Then move down 1 cell
Next
Else copy that name to list.


This would loop until the 1st empty cell is found.


As always, I appreciate your help.
Thanks
jeff- Hide quoted text -


- Show quoted text -


Maybe I wasn't clear, or maybe I'm not understanding your solution.

I want to copy 1 of each name on the list. There might be 50 different
names on the list. Many of those may be on the listed 15, 20 times.
So, the list in Official List sheet might be 300 lines, and if there
were 50 different names on the list, then the list in the Contact List
sheet will be 50 names long.
Thanks for responding
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Copy names to another sheet

Person = "John"
set c = Range("Contact List").find(what:=Person, _
lookin:=xlvalues,lookat:=xlwhole)
firstAddress = c.Address
if c is nothing then
'enter code here
else
do
'enter your code here
Set c = .FindNext(after:=c)
loop while not c is nothing And c.Address < firstAddress
end if

" wrote:

On Oct 10, 11:46 am, Joel wrote:
Person = "John"
set c = Range("Contact
List").find(what:=Person,lookin:=xlvalues,lookat:= xlwhole)
if c is nothing then
'enter code here
else
'enter more code here
end if



" wrote:
I have a list of data in a sheet named Official List. This list is
added to each day. 1 of the columns on this list shows a name of a
person. These persons show up multiple times on the list.
What I want to do is to copy each name once from this list in Official
List to another sheet named Contact List. Ive poked around in past
posts, and couldnt find anything close enough for me to play around
with.
I know how to copy & paste data via macro. What I dont know is how to
make it compare the text in the cell vs the list in Contact List to
see if that name is on the list already.


Im think of something along these lines€¦..


Goto Contacts (named range of column header in Official List sheet)
Down 1


Do until isempty


Read 1st cell
If cell = name from list in sheet Contact List (name already on the
list)
Then move down 1 cell
Next
Else copy that name to list.


This would loop until the 1st empty cell is found.


As always, I appreciate your help.
Thanks
jeff- Hide quoted text -


- Show quoted text -


Maybe I wasn't clear, or maybe I'm not understanding your solution.

I want to copy 1 of each name on the list. There might be 50 different
names on the list. Many of those may be on the listed 15, 20 times.
So, the list in Official List sheet might be 300 lines, and if there
were 50 different names on the list, then the list in the Contact List
sheet will be 50 names long.
Thanks for responding

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
copy all sheet tab names of a file in a cell MA Excel Discussion (Misc queries) 4 September 10th 09 01:14 PM
how to copy workbook names and worksheet names to columns in acces gokop Excel Programming 4 August 27th 07 11:26 AM
Copy Sheet Names to a Column Wester Excel Programming 3 December 16th 06 01:35 PM
Using Sheet names & Workbook names in VBA coding Colin Foster[_5_] Excel Programming 5 July 7th 06 07:04 PM
return all worksheet tab names and chart sheet tab names in report - an example DataFreakFromUtah Excel Programming 2 October 6th 04 08:09 PM


All times are GMT +1. The time now is 03:32 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"