Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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 |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]() 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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Cant find Macro in read only | Excel Discussion (Misc queries) | |||
Read how to two-way link cells, now can't find the example!? | Excel Worksheet Functions | |||
I have a read only xl file, I need it to be read and write | Excel Discussion (Misc queries) | |||
How can a file be converted from Read-Only to Read/Write | Excel Discussion (Misc queries) | |||
Find and match totals Genius Req. this should be easier to read | Excel Worksheet Functions |