A Microsoft Excel forum. ExcelBanter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » ExcelBanter forum » Excel Newsgroups » Excel Discussion (Misc queries)
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Dividing worksheet into multiple workbooks



 
 
Thread Tools Display Modes
  #1  
Old May 31st 12, 09:04 PM
MadMak0203 MadMak0203 is offline
Junior Member
 
First recorded activity by ExcelBanter: Mar 2012
Posts: 2
Default Dividing worksheet into multiple workbooks

I have a worksheet in excel that has financial data for several departments and schools. The data is across 2 columns and 948 rows. I need to break the data down into multiple workbooks so I can use and existing email macro to send them to managers.

There is a unique character that separates the data and I was able to use a previously written macro to enter page breaks which is below, but I'm having trouble using the same unique character (or page break) to put the data into separate workbooks. Any ideas?

Dim PBRange As Range, PB As Range
With ActiveSheet
Set PBRange = .Range("A1:A1000")
For Each PB In PBRange
If PB.Value = "***********" Then
.HPageBreaks.Add befo=PB
End If
Next
End With
Ads
  #2  
Old June 6th 12, 01:03 PM posted to microsoft.public.excel.misc
Bob Flanagan[_4_]
external usenet poster
 
Posts: 29
Default Dividing worksheet into multiple workbooks

Take a look at the Data Extraction Assistant. It is designed to create
multiple workbooks from one worksheet.

http://www.add-ins.com/data_extraction_assistant.htm

Robert Flanagan
Add-ins.com LLC
http://www.add-ins.com
Productivity add-ins and downloadable books on VB macros for Excel



On May 31, 4:04*pm, MadMak0203 >
wrote:
> I have a worksheet in excel that has financial data for several
> departments and schools. *The data is across 2 columns and 948 rows. *I
> need to break the data down into multiple workbooks so I can use and
> existing email macro to send them to managers.
>
> There is a unique character that separates the data and I was able to
> use a previously written macro to enter page breaks which is below, but
> I'm having trouble using the same unique character (or page break) to
> put the data into separate workbooks. *Any ideas?
>
> Dim PBRange As Range, PB As Range
> With ActiveSheet
> Set PBRange = .Range("A1:A1000")
> For Each PB In PBRange
> If PB.Value = "***********" Then
> HPageBreaks.Add befo=PB
> End If
> Next
> End With
>
> --
> MadMak0203


  #3  
Old June 6th 12, 08:51 PM posted to microsoft.public.excel.misc
Don Guillett[_2_]
external usenet poster
 
Posts: 1,506
Default Dividing worksheet into multiple workbooks

On Thursday, May 31, 2012 3:04:28 PM UTC-5, MadMak0203 wrote:
> I have a worksheet in excel that has financial data for several
> departments and schools. The data is across 2 columns and 948 rows. I
> need to break the data down into multiple workbooks so I can use and
> existing email macro to send them to managers.
>
> There is a unique character that separates the data and I was able to
> use a previously written macro to enter page breaks which is below, but
> I'm having trouble using the same unique character (or page break) to
> put the data into separate workbooks. Any ideas?
>
> Dim PBRange As Range, PB As Range
> With ActiveSheet
> Set PBRange = .Range("A1:A1000")
> For Each PB In PBRange
> If PB.Value = "***********" Then
> HPageBreaks.Add befo=PB
> End If
> Next
> End With
>
>
>
>
> --
> MadMak0203


Instead why not use a macro to copy the worksheet to a new book>email active sheet,ie:

for each ws in worksheets
ws.copy
activeworkbook.email
ws.close
next ws



  #4  
Old June 6th 12, 08:57 PM posted to microsoft.public.excel.misc
GS[_2_]
external usenet poster
 
Posts: 2,235
Default Dividing worksheet into multiple workbooks

It happens that Don Guillett formulated :

I think you really meant...
> for each ws in worksheets
> ws.copy
> activeworkbook.email


activeworkbook.close

> next ws


--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion


 




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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple workbooks to one worksheet Steve Excel Discussion (Misc queries) 3 March 26th 09 01:00 PM
Copy Multiple Workbooks to Worksheet Darrell Lankford Excel Programming 2 March 9th 07 06:33 PM
Paste worksheet into multiple workbooks Rookie_User Excel Programming 0 August 1st 06 12:58 AM
Summary Worksheet from Multiple Workbooks eddie_zoom Excel Worksheet Functions 1 February 22nd 06 03:42 PM
splitting worksheet into multiple workbooks Rob Excel Programming 6 December 13th 04 10:25 PM


All times are GMT +1. The time now is 02:38 PM.


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