Dividing worksheet into multiple workbooks

M

MadMak0203

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

There is a unique character that separates the data and I was able t
use a previously written macro to enter page breaks which is below, bu
I'm having trouble using the same unique character (or page break) t
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 before:=PB
End If
Next
End Wit
 
D

Don Guillett

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 before:=PB
End If
Next
End With

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
 

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