Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default 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
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
How can I copy big ranges of cells without drag or copy/paste? Ricardo Julio Excel Discussion (Misc queries) 3 March 23rd 10 02:38 PM
Copy and paste versus copy and insert copied cells Alana New Users to Excel 1 September 28th 07 08:58 PM
How can I copy the values of all selected cells to the same cells inanother Sheet [email protected] Excel Programming 2 August 8th 06 05:45 PM
Copy/Paste how to avoid the copy of formula cells w/o calc values Dennis Excel Discussion (Misc queries) 10 March 2nd 06 10:47 PM
Copy data into cells until changes trigger new copy mdeanda Excel Programming 2 April 25th 05 01:32 PM


All times are GMT +1. The time now is 10:58 AM.

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

About Us

"It's about Microsoft Excel"