Ideas for VBA logic

normpam

Active Member
Joined
Oct 30, 2002
Messages
355
So, I've got a list of names in Column C, and in Column E a list of Departments, sorted in ascending order

John Smith 1
Mary Jones 1
Barry Sanders 2
Harry Stevens 3

I have already created VBA code to automatically add sheets and name them based on the list of departments. Now I would like to populate each sheet with the names from Column C, that correspond with the department numbers. So, for example, I need to put the first two names into the Sheet named 1, then Barry Sanders in the Sheet named 2, etc.

I have an idea about how to get it done, but am looking for better ways that would be more logical and simpler.

Any ideas are much appreciated!
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
You could use advanced filter to copy the names for each department to the relevant sheet.
 
Upvote 0

Forum statistics

Threads
1,214,848
Messages
6,121,914
Members
449,054
Latest member
luca142

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