View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
STEVE BELL STEVE BELL is offline
external usenet poster
 
Posts: 692
Default Create Multiple Worksheets from One

(untested code)

You could loop each row and copy each:

==========================================
Dim lrw1 as long, lrw2 as long, rw1 as long

lrw1 = ActiveSheet.Cells(Rows.COUNT, "A").Row

lrw2 = Sheets(ActiveSheet.Cells(1,3).Text).Cells(Rows.COU NT, "A").Row ' or
however you identify your sheet to paste to

Activesheet.Rows(1).Copy _
Destination:=Sheets(ActiveSheet.Cells(1,3).Text).C ells(1,lrw2)

For rw1 = 2 to lrw1
lrw2 = Sheets(ActiveSheet.Cells(rw1,1).Text) ' or however you identify
your sheet to paste to

Activesheet.Rows(rw1).Copy _
Destination:=Sheets(ActiveSheet.Cells(rw1,3).Text) .Cells(1,lrw2)

Next
=============================================
You might also try:

Sheets("paste to sheet").Rows(lrw2)=Sheets("master sheet").Rows(lrw1)

The trick is transforming column C into a sheet reference.

Don't know how long this will take.

You could get creative and define blocks of rows to paste...

--
steveB

Remove "AYN" from email to respond
"Kdub via OfficeKB.com" wrote in message
...
I have a worksheet that contains about 3000 rows. I would like to cut data
from this worksheet and copy all data whenever the value in column C
changes. For example, for this worksheet:

A B C
163 4/4/2005 51
168 4/2/2005 51
123 4/5/2005 62
128 4/1/2005 62
187 4/9/2005 71

I need to create three new worksheets, the first containing rows 1 and 2,
the second containing rows 3 and 4, and the third containing row 5. I'm
not sure of the best way to go about this. Any suggestions welcome.