Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 78
Default Split Workbook into Multiple Workbooks

Hi- I have a macro that currently generates commission statements for my
sales reps into a new workbook based on a list of names. I can either
generate one file with all statements or individual files for each statement.

I would really like to create district workbooks. I have 20 districts, each
with varying number of sales reps. I'd like 20 separate workbooks.

The macro that I currently have looks at column A (Rep Names) to create the
statements. Is there a way to look at column B (District #) to create
separate workbooks.


Right now I have to run the macro for district one. Paste the names for
district two and run again, paste the names for district 3 and run again, etc.

Thanks,
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Split Workbook into Multiple Workbooks

Maybe this is I understand you correct?
http://www.rondebruin.nl/copy5.htm

Try this example
http://www.rondebruin.nl/copy5_3.htm


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"jackie" wrote in message ...
Hi- I have a macro that currently generates commission statements for my
sales reps into a new workbook based on a list of names. I can either
generate one file with all statements or individual files for each statement.

I would really like to create district workbooks. I have 20 districts, each
with varying number of sales reps. I'd like 20 separate workbooks.

The macro that I currently have looks at column A (Rep Names) to create the
statements. Is there a way to look at column B (District #) to create
separate workbooks.


Right now I have to run the macro for district one. Paste the names for
district two and run again, paste the names for district 3 and run again, etc.

Thanks,

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 78
Default Split Workbook into Multiple Workbooks

Hi Ron-
I am trying to work through this to make work with what I have. I've gotten
to the part in your code where you copy the visible data. I need something
that will name the visible cells in column A only.

A piece of my old code looked something like this:
Set NameRng = .Range("A2", .Cells(.Rows.Count, "A").End(xlUp))

For Each myCell In NameRng.Cells
Template.Copy _
After:=NewWkbk.Sheets(NewWkbk.Sheets.Count)

I need NameRng now to refer to only the visible cells in column A after the
filter. If it makes a difference, I have filtered based on data in column B.


"Ron de Bruin" wrote:

Maybe this is I understand you correct?
http://www.rondebruin.nl/copy5.htm

Try this example
http://www.rondebruin.nl/copy5_3.htm


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"jackie" wrote in message ...
Hi- I have a macro that currently generates commission statements for my
sales reps into a new workbook based on a list of names. I can either
generate one file with all statements or individual files for each statement.

I would really like to create district workbooks. I have 20 districts, each
with varying number of sales reps. I'd like 20 separate workbooks.

The macro that I currently have looks at column A (Rep Names) to create the
statements. Is there a way to look at column B (District #) to create
separate workbooks.


Right now I have to run the macro for district one. Paste the names for
district two and run again, paste the names for district 3 and run again, etc.

Thanks,

.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Split Workbook into Multiple Workbooks

If there's always at least one visible cell in that filtered range:

For Each myCell In NameRng.Cells.specialcells(xlcelltypevisible).cell s

If your filter may cause 0 visible rows (not including the header), I'd check
with something like:

Dim NameRngVis as range 'near the other declarations.
....

set namerngvis = nothing
on error resume next
set namerngvis=NameRng.Cells.specialcells(xlcelltypevi sible)
on error goto 0

if namerngvis is nothing then
msgbox "No visible cells!"
exit sub '????????
else
for each mycell in NameRngvis.Cells
....

jackie wrote:

Hi Ron-
I am trying to work through this to make work with what I have. I've gotten
to the part in your code where you copy the visible data. I need something
that will name the visible cells in column A only.

A piece of my old code looked something like this:
Set NameRng = .Range("A2", .Cells(.Rows.Count, "A").End(xlUp))

For Each myCell In NameRng.Cells
Template.Copy _
After:=NewWkbk.Sheets(NewWkbk.Sheets.Count)

I need NameRng now to refer to only the visible cells in column A after the
filter. If it makes a difference, I have filtered based on data in column B.

"Ron de Bruin" wrote:

Maybe this is I understand you correct?
http://www.rondebruin.nl/copy5.htm

Try this example
http://www.rondebruin.nl/copy5_3.htm


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"jackie" wrote in message ...
Hi- I have a macro that currently generates commission statements for my
sales reps into a new workbook based on a list of names. I can either
generate one file with all statements or individual files for each statement.

I would really like to create district workbooks. I have 20 districts, each
with varying number of sales reps. I'd like 20 separate workbooks.

The macro that I currently have looks at column A (Rep Names) to create the
statements. Is there a way to look at column B (District #) to create
separate workbooks.


Right now I have to run the macro for district one. Paste the names for
district two and run again, paste the names for district 3 and run again, etc.

Thanks,

.


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Split Workbook into Multiple Workbooks

Jackie

Have you written the Macro or recorded it ?

If you can programme in VBA I can send you a routine that will take a BIG
Workbook and split it various smaller workbooks based upon the generic names
of the worksheets in the BIG Workbook

George

"jackie" wrote:

Hi- I have a macro that currently generates commission statements for my
sales reps into a new workbook based on a list of names. I can either
generate one file with all statements or individual files for each statement.

I would really like to create district workbooks. I have 20 districts, each
with varying number of sales reps. I'd like 20 separate workbooks.

The macro that I currently have looks at column A (Rep Names) to create the
statements. Is there a way to look at column B (District #) to create
separate workbooks.


Right now I have to run the macro for district one. Paste the names for
district two and run again, paste the names for district 3 and run again, etc.

Thanks,



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 78
Default Split Workbook into Multiple Workbooks

This particular macro I wrote with the help of my friends on this website.

Anything you can provide would be helpful.

Thanks!

"George from Central Trains Birmingham UK" wrote:

Jackie

Have you written the Macro or recorded it ?

If you can programme in VBA I can send you a routine that will take a BIG
Workbook and split it various smaller workbooks based upon the generic names
of the worksheets in the BIG Workbook

George

"jackie" wrote:

Hi- I have a macro that currently generates commission statements for my
sales reps into a new workbook based on a list of names. I can either
generate one file with all statements or individual files for each statement.

I would really like to create district workbooks. I have 20 districts, each
with varying number of sales reps. I'd like 20 separate workbooks.

The macro that I currently have looks at column A (Rep Names) to create the
statements. Is there a way to look at column B (District #) to create
separate workbooks.


Right now I have to run the macro for district one. Paste the names for
district two and run again, paste the names for district 3 and run again, etc.

Thanks,

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Split data from 1 workbook into multiple workbooks based on criter bUncE Excel Worksheet Functions 0 October 29th 07 03:26 PM
Combine multiple workbooks into 1 workbook w/ multiple worksheets buffgirl71 Excel Discussion (Misc queries) 1 May 13th 06 12:28 PM
Combine multiple workbooks into 1 workbook w/ multiple worksheets buffgirl71 Excel Discussion (Misc queries) 2 May 12th 06 10:30 PM
Can I split worksheets from one workbook into individual workbooks Rosana Excel Discussion (Misc queries) 0 September 19th 05 08:03 PM
What's faster? 1 workbook or multiple workbooks? WTG Excel Worksheet Functions 2 August 11th 05 05:51 PM


All times are GMT +1. The time now is 10:24 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"