Question - VBA Macro to select Row data based on dynamic column data

Eviltauro

New Member
Joined
May 24, 2014
Messages
12
Hi Guys,


First of all, apologies. I could not figure out how to present the below spreadsheet example with the formatting (doh!).

Any hoo, I am trying to create a VBA procedure to loop through the second column, begining below "Name" and look for select individuals based on a list stored within the macro (for portability). I then want to be able to create a new worksheet and auto magically populate a new row containing the identified Name and the contents from corresponding cells under "Period Number 1, 2, 3 etc.

Mark would be in the "team" list but Bob would not, so only Mark's data would be produced.

So essentially, the output would look like this: -



Name</SPAN>

1</SPAN>

2</SPAN>

3</SPAN>

4</SPAN>

5</SPAN>

Mark</SPAN>​

7.00 </SPAN>​

8.00 </SPAN>​

7.00 </SPAN>​

<TBODY>
</TBODY>


Junk</SPAN></SPAN>
Junk</SPAN></SPAN>
Junk</SPAN></SPAN>
Junk</SPAN></SPAN>
Junk</SPAN></SPAN>
Junk</SPAN></SPAN>
Junk</SPAN></SPAN>
Junk</SPAN></SPAN>
Junk</SPAN></SPAN>
Junk</SPAN></SPAN>
Junk</SPAN></SPAN>
Junk</SPAN></SPAN>
Junk</SPAN></SPAN>
Junk</SPAN></SPAN>
Junk</SPAN></SPAN>
Junk</SPAN></SPAN>
Junk</SPAN></SPAN>
Junk</SPAN></SPAN>
Junk</SPAN></SPAN>
Junk</SPAN></SPAN>
Junk</SPAN></SPAN>
Junk</SPAN></SPAN>
Junk</SPAN></SPAN>
Junk</SPAN></SPAN>
Junk</SPAN></SPAN>
Junk</SPAN></SPAN>
Junk</SPAN></SPAN>
Junk</SPAN></SPAN>
Junk</SPAN></SPAN>
Junk</SPAN></SPAN>
Junk</SPAN></SPAN>
Junk</SPAN></SPAN>
Junk</SPAN></SPAN>
Junk</SPAN></SPAN>
Junk</SPAN></SPAN>
Junk</SPAN></SPAN>
Junk</SPAN></SPAN>
Junk</SPAN></SPAN>
Junk</SPAN></SPAN>
Junk</SPAN></SPAN>
Junk</SPAN></SPAN>
Junk</SPAN></SPAN>
Junk</SPAN></SPAN>
Junk</SPAN></SPAN>
Junk</SPAN></SPAN>
Junk</SPAN></SPAN>
Junk</SPAN></SPAN>
Junk</SPAN></SPAN>
Dept</SPAN></SPAN>
Name</SPAN></SPAN>
Role</SPAN></SPAN>
Junk01</SPAN></SPAN>
Junk02</SPAN></SPAN>
Junk03</SPAN></SPAN>
Period No</SPAN></SPAN>
1</SPAN></SPAN>
2</SPAN></SPAN>
3</SPAN></SPAN>
4</SPAN></SPAN>
5</SPAN></SPAN>
JOB POS 01</SPAN></SPAN>
Projected Hours</SPAN></SPAN>
JOB POS 02</SPAN></SPAN>
Projected Hours</SPAN></SPAN>
JOB POS 03</SPAN></SPAN>
Projected Hours</SPAN></SPAN>
JOB POS 04</SPAN></SPAN>
Projected Hours</SPAN></SPAN>
JOB POS 05</SPAN></SPAN>
Projected Hours</SPAN></SPAN>
JOB POS 06</SPAN></SPAN>
Projected Hours</SPAN></SPAN>
Finance</SPAN></SPAN>
Bob</SPAN></SPAN>
JOB POS 07</SPAN></SPAN>
Projected Hours</SPAN></SPAN>
7.00 </SPAN></SPAN>
7.00 </SPAN></SPAN>
JOB POS 08</SPAN></SPAN>
Projected Hours</SPAN></SPAN>
JOB POS 09</SPAN></SPAN>
Projected Hours</SPAN></SPAN>
JOB POS 10</SPAN></SPAN>
Projected Hours</SPAN></SPAN>
JOB POS 11</SPAN></SPAN>
Projected Hours</SPAN></SPAN>
JOB POS 12</SPAN></SPAN>
Projected Hours</SPAN></SPAN>
IT</SPAN></SPAN>
Mark</SPAN></SPAN>
JOB POS 13</SPAN></SPAN>
Projected Hours</SPAN></SPAN>
7.00 </SPAN></SPAN>
8.00 </SPAN></SPAN>
7.00 </SPAN></SPAN>
JOB POS 14</SPAN></SPAN>
Projected Hours</SPAN></SPAN>
Tot Period</SPAN></SPAN>
14.00 </SPAN></SPAN>
8.00 </SPAN></SPAN>
0.00 </SPAN></SPAN>
7.00 </SPAN></SPAN>
7.00 </SPAN></SPAN>

<TBODY>
</TBODY>












Many thanks and now the challenge has been set :confused:
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"

Forum statistics

Threads
1,214,950
Messages
6,122,436
Members
449,083
Latest member
Ava19

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top