ShadowRecon10
New Member
- Joined
- Aug 5, 2017
- Messages
- 3
Hello All,
I've been trying to figure out how to write a VBA macro to loop through the cells of a column, matching cell(s) with a criteria, copy a cell from that row to a different sheet, and then print a specified selection.
This table is located on Sheet "Data". I need to loop through Column C "Manager". When looping through C, I am looking for instances of "Thomas,Kelly". When an instance of "Thomas,Kelly" is found, I want to copy the User cell and paste it into Cell B6 on Sheet "Report". My Report sheet will update other data based on the User pasted into it, then once I do my selection print on the Report Sheet, I want the loop to continue back on the "Data" sheet until the next instance of "Thomas,Kelly" and do the same thing, copy the User cell to Report B6, do my update and print, and continue on until the search gets to the last row.
[TABLE="class: cms_table_grid, width: 100"]
<tbody>[TR]
[TD]User[/TD]
[TD]Name[/TD]
[TD]Manager[/TD]
[/TR]
[TR]
[TD]john1[/TD]
[TD]Herbert,John[/TD]
[TD]Thomas,Kelly[/TD]
[/TR]
[TR]
[TD]joejoe20[/TD]
[TD]Johnson,Josph[/TD]
[TD]Blanton,Joe[/TD]
[/TR]
[TR]
[TD]willy5[/TD]
[TD]Rose,Wilson[/TD]
[TD]Thomas,Kelly[/TD]
[/TR]
[TR]
[TD]ronny12[/TD]
[TD]Wilson,Ronny[/TD]
[TD]Melody,Sarah[/TD]
[/TR]
</tbody>[/TABLE]
Any and all help would be appreciated. I've been racking my brain on it for hours, but can't figure out how to do it.
Thank you in advance for the help.
I've been trying to figure out how to write a VBA macro to loop through the cells of a column, matching cell(s) with a criteria, copy a cell from that row to a different sheet, and then print a specified selection.
This table is located on Sheet "Data". I need to loop through Column C "Manager". When looping through C, I am looking for instances of "Thomas,Kelly". When an instance of "Thomas,Kelly" is found, I want to copy the User cell and paste it into Cell B6 on Sheet "Report". My Report sheet will update other data based on the User pasted into it, then once I do my selection print on the Report Sheet, I want the loop to continue back on the "Data" sheet until the next instance of "Thomas,Kelly" and do the same thing, copy the User cell to Report B6, do my update and print, and continue on until the search gets to the last row.
[TABLE="class: cms_table_grid, width: 100"]
<tbody>[TR]
[TD]User[/TD]
[TD]Name[/TD]
[TD]Manager[/TD]
[/TR]
[TR]
[TD]john1[/TD]
[TD]Herbert,John[/TD]
[TD]Thomas,Kelly[/TD]
[/TR]
[TR]
[TD]joejoe20[/TD]
[TD]Johnson,Josph[/TD]
[TD]Blanton,Joe[/TD]
[/TR]
[TR]
[TD]willy5[/TD]
[TD]Rose,Wilson[/TD]
[TD]Thomas,Kelly[/TD]
[/TR]
[TR]
[TD]ronny12[/TD]
[TD]Wilson,Ronny[/TD]
[TD]Melody,Sarah[/TD]
[/TR]
</tbody>[/TABLE]
Any and all help would be appreciated. I've been racking my brain on it for hours, but can't figure out how to do it.
Thank you in advance for the help.