Dynamically creating worksheet tabs based on unique values in a column

D

DoctorV

I have a workbook which runs a macro that utilizes Microsoft Query t
pull data from an Access Query into a Sheet named MainForm. This par
works just fine. After this happens, I need another Macro to determin
the unique values in Column D (Field Name in Row 1 for this is Mo
Number) range is cell d2 to however many rows are retrieved, and the
create new worksheet tabs based on the Unique Value and copy and past
all corresponding data and name the new sheet tab whatever the Uniqu
Value is.

Example: Mod Number would have Unique Values of 00 01 02 03 04 05. I
would then create a worksheet tabs named 00 01 02 03 04 05 and the
copy all of the data in the MainForm tab where Mod Number = 00 into th
newly created 00 tab
 
K

Ken Wright

Another option might be to have the macro create a Pivottable based on your
data, throw the Mod into the page fields and then have it use the Show pages
option to create all the individual pages for you.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top