• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Create workbooks based on given names in Ranges

Michael

New Member
Hi,


I want to create new workbooks based on given names in cell A2 to A21.


And in the newly created workbook on sheet1 in C5 should paste the stud no that i have mentioned in the attached workbook.


Like stud no, stud name should paste in C6.


Can you please help me to automate this work.


Here is the file: http://www.2shared.com/file/A_ckRFx6/sample.html


Thanks for your help in advance.


Regards,

Michael
 
Hi Michael ,


Your post has coincided with the weekend ; please have some patience ; you may get replies today.


Narayan
 
Hi Michael,

I guess StudName is UserName..


Can you please check the below file..


https://dl.dropbox.com/u/78831150/Excel/Create%20workbooks%20%28Michael%29.xlsb


-----

[pre]
Code:
Sub Michael_Create_workbooks()
Dim NoOfFiles As Long, source As Worksheet
Set source = ThisWorkbook.Sheets(1)
For i = 2 To [A65536].End(xlUp).Row
Workbooks.Add (1)
ActiveSheet.[C5] = source.Range("C" & i)
ActiveSheet.[C6] = source.Range("B" & i)
ActiveWorkbook.SaveAs ThisWorkbook.Path & "" & source.Range("A" & i) & ".xls", xlWorkbookNormal
ActiveWorkbook.Close True
Next i
MsgBox "All Files has been created in the same folder"
End Sub
[/pre]
-----

Regards,

Deb
 
Hi Deb,


How! Great! I didn't have had seen like Chandoo.org. It save my time a lot. Thanks for your effort for me Deb.


And Can I select the save location of newly creating workbooks?


Could you please add the below activity with that.


It should copy the student mark details and paste it in the newly created workbook.


E.g:


1. Newly created workbook "File1"(A2 in existing file).


2. Student no. is "1" (C2 in existing file).


3. It should copy the header and mark details with all formats related to student no. "1" and paste it in workbook "File1".


4. Below the mark details it should paste the comment mentioned in "E23" in existing workbook and save it.


Here is the sample workbook.

http://www.2shared.com/file/mAw4v8Ye/Create_workbooks__Michael__1_.html


If you have any questions please let me know.


Thank you,

Michael
 
Back
Top