Microsoft Office Forums


Reply
Thread Tools Display Modes

Split worksheet into many based on Cell

 
 
Brian Nordberg
Guest
Posts: n/a
 
      09-23-2003, 02:55 PM
I have a excel doc with an Department ID field that breaks
down employees for that department. I need to
programatically make a new document for each occurrence of
the department within the doc.
For example
DeptID Person
1 Brian
1 Rob
2 John
2 Mary
3 Colleen

would be broken into 3 new files that contain only 1
departments worth of data.
Ideas?
Thanks

 
Reply With Quote
 
 
 
 
Tushar Mehta
Guest
Posts: n/a
 
      09-23-2003, 05:03 PM
[This followup was posted to microsoft.public.excel with an email copy
to Brian Nordberg.
Please use the newsgroup for further discussion.]

To separate data based on the department ID into worksheets (not
workbooks), create a PivotTable with the dept ID as the Page field.
One of the options XL offers is to split the data for the table into
separate worksheets based on the Page Field value.

Then, save each worksheet as a separate workbook.

--
Trouble finding replies to your posts? Use a newsreader. See the
tutorial 'Outlook Express and Newsgroups' on my web site

Regards,

Tushar Mehta, MS MVP -- Excel
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions

In article <00eb01c381e2$aa2d66c0$(E-Mail Removed)>,
(E-Mail Removed) says...
> I have a excel doc with an Department ID field that breaks
> down employees for that department. I need to
> programatically make a new document for each occurrence of
> the department within the doc.
> For example
> DeptID Person
> 1 Brian
> 1 Rob
> 2 John
> 2 Mary
> 3 Colleen
>
> would be broken into 3 new files that contain only 1
> departments worth of data.
> Ideas?
> Thanks
>
>

 
Reply With Quote
 
Brian Nordberg
Guest
Posts: n/a
 
      09-23-2003, 08:27 PM
I should expound.
I will have over 330 department ID's so I have to do it
programatically or I will be doing it all year.
Ideas?

>-----Original Message-----
>
>To separate data based on the department ID into

worksheets (not
>workbooks), create a PivotTable with the dept ID as the

Page field.
>One of the options XL offers is to split the data for the

table into
>separate worksheets based on the Page Field value.
>
>Then, save each worksheet as a separate workbook.
>
>--
>Trouble finding replies to your posts? Use a

newsreader. See the
>tutorial 'Outlook Express and Newsgroups' on my web site
>
>Regards,
>
>Tushar Mehta, MS MVP -- Excel
>www.tushar-mehta.com
>Excel, PowerPoint, and VBA add-ins, tutorials
>Custom MS Office productivity solutions
>
>In article <00eb01c381e2$aa2d66c0$(E-Mail Removed)>,
>(E-Mail Removed) says...
>> I have a excel doc with an Department ID field that

breaks
>> down employees for that department. I need to
>> programatically make a new document for each occurrence

of
>> the department within the doc.
>> For example
>> DeptID Person
>> 1 Brian
>> 1 Rob
>> 2 John
>> 2 Mary
>> 3 Colleen
>>
>> would be broken into 3 new files that contain only 1
>> departments worth of data.
>> Ideas?
>> Thanks
>>
>>

>.
>

 
Reply With Quote
 
Tushar Mehta
Guest
Posts: n/a
 
      09-23-2003, 09:03 PM
Record a macro doing what I suggested, but save just one worksheet.
Then, share that here and someone should be able to generalize the
macro to an arbitrary number of worksheets.

--
Regards,

Tushar Mehta, MS MVP -- Excel
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions

In article <c85401c38211$277c2c50$(E-Mail Removed)>,
(E-Mail Removed) says...
> I should expound.
> I will have over 330 department ID's so I have to do it
> programatically or I will be doing it all year.
> Ideas?
>
> >-----Original Message-----
> >
> >To separate data based on the department ID into

> worksheets (not
> >workbooks), create a PivotTable with the dept ID as the

> Page field.
> >One of the options XL offers is to split the data for the

> table into
> >separate worksheets based on the Page Field value.
> >
> >Then, save each worksheet as a separate workbook.
> >
> >--
> >Trouble finding replies to your posts? Use a

> newsreader. See the
> >tutorial 'Outlook Express and Newsgroups' on my web site
> >
> >Regards,
> >
> >Tushar Mehta, MS MVP -- Excel
> >www.tushar-mehta.com
> >Excel, PowerPoint, and VBA add-ins, tutorials
> >Custom MS Office productivity solutions
> >
> >In article <00eb01c381e2$aa2d66c0$(E-Mail Removed)>,
> >(E-Mail Removed) says...
> >> I have a excel doc with an Department ID field that

> breaks
> >> down employees for that department. I need to
> >> programatically make a new document for each occurrence

> of
> >> the department within the doc.
> >> For example
> >> DeptID Person
> >> 1 Brian
> >> 1 Rob
> >> 2 John
> >> 2 Mary
> >> 3 Colleen
> >>
> >> would be broken into 3 new files that contain only 1
> >> departments worth of data.
> >> Ideas?
> >> Thanks
> >>
> >>

> >.
> >

>

 
Reply With Quote
 
Dave Peterson
Guest
Posts: n/a
 
      09-23-2003, 09:53 PM
You might be able to steal some code from Debra Dalgleish's sample workbook at:

http://www.contextures.com/excelfiles.html
Look for:
Update Sheets from Master -- uses an Advanced Filter to send data from
Master sheet to individual worksheets -- replaces old data with current.
AdvFilterCity.xls 55 kb

Brian Nordberg wrote:
>
> I have a excel doc with an Department ID field that breaks
> down employees for that department. I need to
> programatically make a new document for each occurrence of
> the department within the doc.
> For example
> DeptID Person
> 1 Brian
> 1 Rob
> 2 John
> 2 Mary
> 3 Colleen
>
> would be broken into 3 new files that contain only 1
> departments worth of data.
> Ideas?
> Thanks


--

Dave Peterson
(E-Mail Removed)
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
link worksheet cell to a spreadsheet in a multipage........Help ASU Access Newsgroup 1 06-07-2006 08:40 PM
split worksheet patrick072040 Excel Newsgroup 2 09-15-2003 11:59 AM
Split name cell Aaron Stamboulieh Excel Newsgroup 2 08-23-2003 02:27 AM
Count worksheet with specific value in a cell John Chow Excel Newsgroup 1 07-27-2003 08:54 PM
Re: split cell AndrewK Excel Newsgroup 0 07-01-2003 05:50 AM



All times are GMT. The time now is 05:06 PM.
Microsoft Office Forums is not affiliated with Microsoft Corporation.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92