Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Tom Tom is offline
external usenet poster
 
Posts: 49
Default How to read and find a name?

Hi,

Column 1 Sheet1 carries a list of names:
David
Susan
Kathie
John
etc.

Column 1 Sheet2 carries another list:
Jack
Susan
Fred
David
Sam
etc.

How do you write a macro to read David in Sheet1 then goes to find it in
Sheet2?
Perform a task, then returns to Sheet1, comes down 1 row to read Susan and
goes back to Sheet2, to find Susan and performs the same task. Repeat the
process until it reads a blank name in Sheet1 and stops. Thank you for any
help.

TIA
Tom


  #3   Report Post  
Posted to microsoft.public.excel.misc
Tom Tom is offline
external usenet poster
 
Posts: 49
Default How to read and find a name?

Excel 2003 doesn't like the line:
msgbox sheet2.find(n,columns(1).row
It says, "Syntax Error"
Thanks Don.

Tom

"Don Guillett" wrote in message
...
Simplest version. NO need to goto the other sheet

sub loopeach()
for each n in sheet1.range("a1:a21")
msgbox sheet2.find(n,columns(1).row
next n
end sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Tom" wrote in message
...
Hi,

Column 1 Sheet1 carries a list of names:
David
Susan
Kathie
John
etc.

Column 1 Sheet2 carries another list:
Jack
Susan
Fred
David
Sam
etc.

How do you write a macro to read David in Sheet1 then goes to find it in
Sheet2?
Perform a task, then returns to Sheet1, comes down 1 row to read Susan
and goes back to Sheet2, to find Susan and performs the same task. Repeat
the process until it reads a blank name in Sheet1 and stops. Thank you
for any help.

TIA
Tom




  #5   Report Post  
Posted to microsoft.public.excel.misc
Tom Tom is offline
external usenet poster
 
Posts: 49
Default How to read and find a name?

Can't it be done automatically without the use of a message box?
Sheet 1 holds the names of say 50 people whose weekly wages will go up by
7.5% recorded in Sheet 2 - the task to be performed. I then want to replace
the list in Sheet 1 with 250 other names whose wages will be going up by 5%
and so on.

"Don Guillett" wrote in message
...
Haste make waste. Still TOO simple but you get the idea

Excel 2003 doesn't like the line:
msgbox sheet2.columns(1).find(n).row
It says, "Syntax Error"
Thanks Don.


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Tom" wrote in message
...
Excel 2003 doesn't like the line:
msgbox sheet2.find(n,columns(1).row
It says, "Syntax Error"
Thanks Don.

Tom

"Don Guillett" wrote in message
...
Simplest version. NO need to goto the other sheet

sub loopeach()
for each n in sheet1.range("a1:a21")
msgbox sheet2.find(n,columns(1).row
next n
end sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Tom" wrote in message
...
Hi,

Column 1 Sheet1 carries a list of names:
David
Susan
Kathie
John
etc.

Column 1 Sheet2 carries another list:
Jack
Susan
Fred
David
Sam
etc.

How do you write a macro to read David in Sheet1 then goes to find it
in Sheet2?
Perform a task, then returns to Sheet1, comes down 1 row to read Susan
and goes back to Sheet2, to find Susan and performs the same task.
Repeat the process until it reads a blank name in Sheet1 and stops.
Thank you for any help.

TIA
Tom









  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,522
Default How to read and find a name?


The msgbox was just to show you how it works. You would replace that with
what you want to do.
If desired, send your file to my address below. I will only look if:
1. You send a copy of this message on an inserted sheet
2. You give me the newsgroup and the subject line
3. You send a clear explanation of what you want
4. You send before/after examples and expected results.



--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Tom" wrote in message
...
Can't it be done automatically without the use of a message box?
Sheet 1 holds the names of say 50 people whose weekly wages will go up by
7.5% recorded in Sheet 2 - the task to be performed. I then want to
replace the list in Sheet 1 with 250 other names whose wages will be going
up by 5% and so on.

"Don Guillett" wrote in message
...
Haste make waste. Still TOO simple but you get the idea

Excel 2003 doesn't like the line:
msgbox sheet2.columns(1).find(n).row
It says, "Syntax Error"
Thanks Don.


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Tom" wrote in message
...
Excel 2003 doesn't like the line:
msgbox sheet2.find(n,columns(1).row
It says, "Syntax Error"
Thanks Don.

Tom

"Don Guillett" wrote in message
...
Simplest version. NO need to goto the other sheet

sub loopeach()
for each n in sheet1.range("a1:a21")
msgbox sheet2.find(n,columns(1).row
next n
end sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Tom" wrote in message
...
Hi,

Column 1 Sheet1 carries a list of names:
David
Susan
Kathie
John
etc.

Column 1 Sheet2 carries another list:
Jack
Susan
Fred
David
Sam
etc.

How do you write a macro to read David in Sheet1 then goes to find it
in Sheet2?
Perform a task, then returns to Sheet1, comes down 1 row to read Susan
and goes back to Sheet2, to find Susan and performs the same task.
Repeat the process until it reads a blank name in Sheet1 and stops.
Thank you for any help.

TIA
Tom








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
Cant find Macro in read only Steekvey Excel Discussion (Misc queries) 0 November 8th 06 02:52 PM
Read how to two-way link cells, now can't find the example!? Bill Case Excel Worksheet Functions 0 October 9th 06 07:49 PM
I have a read only xl file, I need it to be read and write drama queen Excel Discussion (Misc queries) 3 July 1st 06 12:25 AM
How can a file be converted from Read-Only to Read/Write Jim in Apopka Excel Discussion (Misc queries) 2 November 19th 05 04:59 PM
Find and match totals Genius Req. this should be easier to read James Excel Worksheet Functions 1 October 3rd 05 10:12 PM


All times are GMT +1. The time now is 10:27 AM.

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

About Us

"It's about Microsoft Excel"