Hello,
I would say I'm relatively new to VBA in particular, and this site as well (it's my first post!).
I am working with Excel 2010.
I need help designing a macro to search a range (B, C in the case of the table below) and based on if a cell in the range has text (B1, B3, B5, B7, C1, C4, C5), for the macro to copy that cell and a cell from column A (A1 & B1, A1 & C1, A3 & B3, etc.) to paste into output in the order of column A then the other column.
[TABLE="class: grid, width: 700"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]Output[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]John Smith[/TD]
[TD]Not Paid[/TD]
[TD]Not in Payroll System[/TD]
[TD]John Smith Not Paid[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]James Smith[/TD]
[TD][/TD]
[TD][/TD]
[TD]John Smith Not in Payroll System[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]Matthew Smith[/TD]
[TD]Not Paid[/TD]
[TD][/TD]
[TD]Matthew Smith Not Paid[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]Michelle Pfeiffer[/TD]
[TD][/TD]
[TD]Is an actress[/TD]
[TD]Michelle Pfeiffer Is an actress[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]HTMLGhozt[/TD]
[TD]Not Paid[/TD]
[TD]Is me![/TD]
[TD]HTMLGhozt Not Paid[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]Stacy Keibler[/TD]
[TD][/TD]
[TD][/TD]
[TD]HTMLGhozt Is me![/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]Apples Galore[/TD]
[TD]Is Apples[/TD]
[TD][/TD]
[TD]Apples Galore Is Apples[/TD]
[/TR]
</tbody>[/TABLE]
If you have any questions please ask!
I would say I'm relatively new to VBA in particular, and this site as well (it's my first post!).
I am working with Excel 2010.
I need help designing a macro to search a range (B, C in the case of the table below) and based on if a cell in the range has text (B1, B3, B5, B7, C1, C4, C5), for the macro to copy that cell and a cell from column A (A1 & B1, A1 & C1, A3 & B3, etc.) to paste into output in the order of column A then the other column.
[TABLE="class: grid, width: 700"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]Output[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]John Smith[/TD]
[TD]Not Paid[/TD]
[TD]Not in Payroll System[/TD]
[TD]John Smith Not Paid[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]James Smith[/TD]
[TD][/TD]
[TD][/TD]
[TD]John Smith Not in Payroll System[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]Matthew Smith[/TD]
[TD]Not Paid[/TD]
[TD][/TD]
[TD]Matthew Smith Not Paid[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]Michelle Pfeiffer[/TD]
[TD][/TD]
[TD]Is an actress[/TD]
[TD]Michelle Pfeiffer Is an actress[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]HTMLGhozt[/TD]
[TD]Not Paid[/TD]
[TD]Is me![/TD]
[TD]HTMLGhozt Not Paid[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]Stacy Keibler[/TD]
[TD][/TD]
[TD][/TD]
[TD]HTMLGhozt Is me![/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]Apples Galore[/TD]
[TD]Is Apples[/TD]
[TD][/TD]
[TD]Apples Galore Is Apples[/TD]
[/TR]
</tbody>[/TABLE]
If you have any questions please ask!
Last edited: