justkodian
New Member
- Joined
- Jun 5, 2019
- Messages
- 2
I have a spreadsheet with items similar to below:[TABLE="width: 500"]
<tbody>[TR]
[TD]#[/TD]
[TD]item code[/TD]
[TD]item description[/TD]
[TD]item size[/TD]
[TD]notes[/TD]
[TD]cost[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]001[/TD]
[TD]Tool Box Prepack[/TD]
[TD]1UN[/TD]
[TD][/TD]
[TD]47.75[/TD]
[/TR]
[TR]
[TD]CONTAINS:[/TD]
[TD]0001[/TD]
[TD]Screwdriver[/TD]
[TD]1UN[/TD]
[TD][/TD]
[TD]2.79[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]002[/TD]
[TD]Ladder[/TD]
[TD]1UN[/TD]
[TD][/TD]
[TD]87.79[/TD]
[/TR]
</tbody>[/TABLE]
I am trying to create a macro that will search for the word "Prepack" in column C and when it finds it to cut the entire row(s) below it that have "CONTAINS:" in column A..the trickier part is they need to be pasted next to end of the row with "Prepack"
so it would look like this after:
[TABLE="width: 500"]
<tbody>[TR]
[TD]#[/TD]
[TD]item code[/TD]
[TD]item description[/TD]
[TD]item size[/TD]
[TD]notes[/TD]
[TD]cost[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]001[/TD]
[TD]Tool Box Prepack[/TD]
[TD]1UN[/TD]
[TD][/TD]
[TD][/TD]
[TD]CONTAINS:[/TD]
[TD]0001[/TD]
[TD]Screwdriver[/TD]
[TD]1UN[/TD]
[TD][/TD]
[TD]2.79[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]002[/TD]
[TD]Ladder[/TD]
[TD]1UN[/TD]
[TD][/TD]
[TD]87.79[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
****** id="cke_pastebin" style="position: absolute; top: 197px; width: 1px; height: 1px; overflow: hidden; left: -1000px;">[TABLE="width: 500"]
<tbody>[TR]
[TD]item code[/TD]
[TD]item description[/TD]
[TD]item size[/TD]
[TD]notes[/TD]
[TD]cost[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]001[/TD]
[TD]Tool Box Prepack[/TD]
[TD]1UN[/TD]
[TD][/TD]
[TD]47.75[/TD]
[/TR]
</tbody>[/TABLE]
</body>And if there are multiple rows below the prepack with CONTAINS: all of the rows get cut and pasted beside
Thanks for the help.
<tbody>[TR]
[TD]#[/TD]
[TD]item code[/TD]
[TD]item description[/TD]
[TD]item size[/TD]
[TD]notes[/TD]
[TD]cost[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]001[/TD]
[TD]Tool Box Prepack[/TD]
[TD]1UN[/TD]
[TD][/TD]
[TD]47.75[/TD]
[/TR]
[TR]
[TD]CONTAINS:[/TD]
[TD]0001[/TD]
[TD]Screwdriver[/TD]
[TD]1UN[/TD]
[TD][/TD]
[TD]2.79[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]002[/TD]
[TD]Ladder[/TD]
[TD]1UN[/TD]
[TD][/TD]
[TD]87.79[/TD]
[/TR]
</tbody>[/TABLE]
I am trying to create a macro that will search for the word "Prepack" in column C and when it finds it to cut the entire row(s) below it that have "CONTAINS:" in column A..the trickier part is they need to be pasted next to end of the row with "Prepack"
so it would look like this after:
[TABLE="width: 500"]
<tbody>[TR]
[TD]#[/TD]
[TD]item code[/TD]
[TD]item description[/TD]
[TD]item size[/TD]
[TD]notes[/TD]
[TD]cost[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]001[/TD]
[TD]Tool Box Prepack[/TD]
[TD]1UN[/TD]
[TD][/TD]
[TD][/TD]
[TD]CONTAINS:[/TD]
[TD]0001[/TD]
[TD]Screwdriver[/TD]
[TD]1UN[/TD]
[TD][/TD]
[TD]2.79[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]002[/TD]
[TD]Ladder[/TD]
[TD]1UN[/TD]
[TD][/TD]
[TD]87.79[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
****** id="cke_pastebin" style="position: absolute; top: 197px; width: 1px; height: 1px; overflow: hidden; left: -1000px;">[TABLE="width: 500"]
<tbody>[TR]
[TD]item code[/TD]
[TD]item description[/TD]
[TD]item size[/TD]
[TD]notes[/TD]
[TD]cost[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]001[/TD]
[TD]Tool Box Prepack[/TD]
[TD]1UN[/TD]
[TD][/TD]
[TD]47.75[/TD]
[/TR]
</tbody>[/TABLE]
</body>And if there are multiple rows below the prepack with CONTAINS: all of the rows get cut and pasted beside
Thanks for the help.