Hi
I need to write code which loops and deletes rows in a workbook (let's call it Book 2), if the name of a row in column A in Book 2 is the same as the name of cell B4 in Book 1.
Please find below some sample data.
For Book 1, the name in cell B4 is "Coffee" in this example (but it could be "Cereals," "Cake," etc). You can copy and paste the data below or type "Coffee into cell B4 of a file called "Book 1."
[TABLE="width: 134"]
<colgroup><col><col></colgroup><tbody>[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Coffee[/TD]
[/TR]
</tbody>[/TABLE]
For Book 2, you can paste the data below or type "Department" in cell A2, "Coffee" in cells A3 and A4, and "Cereals" in A5 and A6. I'd then like to create code that deletes rows that contain the word "Coffee" in column A of this file (because "Coffee" is the value in cell B4 in the first file. Does anyone know how to do this? Thanks in advance.
[TABLE="width: 81"]
<colgroup><col></colgroup><tbody>[TR]
[TD][/TD]
[/TR]
[TR]
[TD]Department[/TD]
[/TR]
[TR]
[TD]Coffee[/TD]
[/TR]
[TR]
[TD]Coffee[/TD]
[/TR]
[TR]
[TD]Cereals[/TD]
[/TR]
[TR]
[TD]Cereals[/TD]
[/TR]
</tbody>[/TABLE]
I need to write code which loops and deletes rows in a workbook (let's call it Book 2), if the name of a row in column A in Book 2 is the same as the name of cell B4 in Book 1.
Please find below some sample data.
For Book 1, the name in cell B4 is "Coffee" in this example (but it could be "Cereals," "Cake," etc). You can copy and paste the data below or type "Coffee into cell B4 of a file called "Book 1."
[TABLE="width: 134"]
<colgroup><col><col></colgroup><tbody>[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Coffee[/TD]
[/TR]
</tbody>[/TABLE]
For Book 2, you can paste the data below or type "Department" in cell A2, "Coffee" in cells A3 and A4, and "Cereals" in A5 and A6. I'd then like to create code that deletes rows that contain the word "Coffee" in column A of this file (because "Coffee" is the value in cell B4 in the first file. Does anyone know how to do this? Thanks in advance.
[TABLE="width: 81"]
<colgroup><col></colgroup><tbody>[TR]
[TD][/TD]
[/TR]
[TR]
[TD]Department[/TD]
[/TR]
[TR]
[TD]Coffee[/TD]
[/TR]
[TR]
[TD]Coffee[/TD]
[/TR]
[TR]
[TD]Cereals[/TD]
[/TR]
[TR]
[TD]Cereals[/TD]
[/TR]
</tbody>[/TABLE]