Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Darius
 
Posts: n/a
Default multiple workfile from one workfile

Hi there;
I have a file with below structu
A1: name
A2:E93 contain data
then
A94: name
A95:E186 contain data
then again
continues till:
A5860: name
A5861:E5952 contain data

each set of data are 91 cells (in a coulmn) after each set there is one row
which in its A column is name. Now what I want is how to make an Excel file
for each 91 set of data (91 Col., 5 Rows) and save them with the names comes
in A cell for that data came as name. So basically I shoudl have many files
which contain just one set of data and keep the original file as it is?
Appreciate any help for this.
Best
Darius
  #2   Report Post  
bigwheel
 
Posts: n/a
Default

OK, here's a rough and ready shot at a method for you:-

For c = 1 To 5954 Step 93
newName = Cells(c, 1).Value
If newName = "" Then
Exit Sub
Else
Workbooks.Add
ActiveWorkbook.SaveAs Filename:= _
newName & ".xls", FileFormat:= _
xlNormal, Password:="", WriteResPassword:="",
ReadOnlyRecommended:=False _
, CreateBackup:=False
End If
Workbooks("Book1").Activate
Sheets("Sheet1").Select
Range(Cells(c + 1, 1), Cells(c + 6, 5)).Copy
Workbooks(newName).Activate
ActiveSheet.Paste
ActiveWorkbook.Save
ActiveWorkbook.Close
Workbooks("Book1").Activate
Sheets("sheet1").Select
Next c

Put this code in your original worksheet and it'll create new files based on
the values in A1, A94 etc (make sure that these will be valid file names) and
preserve your original (change any reference to Book1 to your original
filename and Sheet1 to the correct sheet name)

"Darius" wrote:

Hi there;
I have a file with below structu
A1: name
A2:E93 contain data
then
A94: name
A95:E186 contain data
then again
continues till:
A5860: name
A5861:E5952 contain data

each set of data are 91 cells (in a coulmn) after each set there is one row
which in its A column is name. Now what I want is how to make an Excel file
for each 91 set of data (91 Col., 5 Rows) and save them with the names comes
in A cell for that data came as name. So basically I shoudl have many files
which contain just one set of data and keep the original file as it is?
Appreciate any help for this.
Best
Darius

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
view multiple files in multiple windows on multiple screens. tcom Excel Discussion (Misc queries) 7 September 15th 05 09:35 PM
How do i auto create multiple files from 1 with multiple sheets Kathy Excel Worksheet Functions 0 July 26th 05 01:23 AM
Adding multiple worksheets Craig Excel Worksheet Functions 1 July 6th 05 07:21 PM
Can I get the mode, min, and max with multiple criteria? BobT Excel Discussion (Misc queries) 1 February 15th 05 03:20 AM
XML / parent with multiple children and with multiple children Richard Excel Discussion (Misc queries) 0 January 5th 05 11:49 AM


All times are GMT +1. The time now is 09:14 PM.

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

About Us

"It's about Microsoft Excel"