Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy Cells To Another XLS
I've been a programmer for 10 years now. This simple thing is kicking
my butt. Any help would be appreciated. I have a simple Excel file. It is broken up into "chunks", meaning that every 50 rows is a "chunk". I would like to copy all the data in each of the 50 rows to a seperate new Excel document. Each 50 rows would be in its own file. Can someone point me in the right direction? I would be willing to look at Excel macro code, or stand-alone application code. Anything. Thanks, - Steve |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy Cells To Another XLS
Something like this would propably work. If the original Sheet is called
Data so this code would look for an empty cell in column A to stop the routine. Sub SplitDataToNewSheets() Rw = 1 Sheets("Data").Select Do Until Cells(Rw, 1).Value = "" Rows(Rw & ":" & Rw + 49).Select Selection.Copy Sheets.Add Rows("1:1").Select ActiveSheet.Paste Rw = Rw + 50 Sheets("Data").Select Loop End Sub Regrds, Mika Oukka "Steve Kennedy" wrote in message ups.com... I've been a programmer for 10 years now. This simple thing is kicking my butt. Any help would be appreciated. I have a simple Excel file. It is broken up into "chunks", meaning that every 50 rows is a "chunk". I would like to copy all the data in each of the 50 rows to a seperate new Excel document. Each 50 rows would be in its own file. Can someone point me in the right direction? I would be willing to look at Excel macro code, or stand-alone application code. Anything. Thanks, - Steve |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy Cells To Another XLS
The previous version one did it to new sheets. This one would distribute to
files. -Mika Sub CopyToNewFiles() Rw = 1 Sheets("Data").Select Do Until Cells(Rw, 1).Value = "" Rows(Rw & ":" & Rw + 49).Select Selection.Copy Workbooks.Add Rows("1:1").Select ActiveSheet.Paste ActiveWorkbook.SaveAs Filename:="C:\temp\RwsFrom" & Rw & ".xls" ActiveWorkbook.Close Rw = Rw + 50 Sheets("Data").Select Loop End Sub "Mika Oukka" wrote in message i.fi... Something like this would propably work. If the original Sheet is called Data so this code would look for an empty cell in column A to stop the routine. Sub SplitDataToNewSheets() Rw = 1 Sheets("Data").Select Do Until Cells(Rw, 1).Value = "" Rows(Rw & ":" & Rw + 49).Select Selection.Copy Sheets.Add Rows("1:1").Select ActiveSheet.Paste Rw = Rw + 50 Sheets("Data").Select Loop End Sub Regrds, Mika Oukka "Steve Kennedy" wrote in message ups.com... I've been a programmer for 10 years now. This simple thing is kicking my butt. Any help would be appreciated. I have a simple Excel file. It is broken up into "chunks", meaning that every 50 rows is a "chunk". I would like to copy all the data in each of the 50 rows to a seperate new Excel document. Each 50 rows would be in its own file. Can someone point me in the right direction? I would be willing to look at Excel macro code, or stand-alone application code. Anything. Thanks, - Steve |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy Cells To Another XLS
See also this page Steve
http://www.rondebruin.nl/copy5.htm -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "Steve Kennedy" wrote in message ups.com... I've been a programmer for 10 years now. This simple thing is kicking my butt. Any help would be appreciated. I have a simple Excel file. It is broken up into "chunks", meaning that every 50 rows is a "chunk". I would like to copy all the data in each of the 50 rows to a seperate new Excel document. Each 50 rows would be in its own file. Can someone point me in the right direction? I would be willing to look at Excel macro code, or stand-alone application code. Anything. Thanks, - Steve |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How can I copy big ranges of cells without drag or copy/paste? | Excel Discussion (Misc queries) | |||
Copy and paste versus copy and insert copied cells | New Users to Excel | |||
How can I copy the values of all selected cells to the same cells inanother Sheet | Excel Programming | |||
Copy/Paste how to avoid the copy of formula cells w/o calc values | Excel Discussion (Misc queries) | |||
Copy data into cells until changes trigger new copy | Excel Programming |