I have a bunch of company names and blank cells in column A. I wish to create a new workbook for each company name.
Software & Op system: Office 2010, Acrobat X Pro, Windows 7
Hi Xx7,
Use the following code:-
Sample file is also attached. Thanks.Sub WkBk() o = ActiveWorkbook.Name Cells(1, 1).Select k = Range("a65536").End(xlUp).Row For n = 1 To k i = ActiveCell.Value If i <> "" Then Application.Workbooks.Add ActiveWorkbook.SaveAs (i) Windows(o).Activate ActiveCell.Offset(1, 0).Select Else ActiveCell.Offset(1, 0).Select End If Next End Sub
Regards,
DILIPandey
<click on below 'star' if this helps>
DILIPandey
+919810929744
dilipandey@gmail.com
that's great. Is there anyway to save them to a folder instead of opening them?
Thanks!![]()
Software & Op system: Office 2010, Acrobat X Pro, Windows 7
you are welcome Xx7,
Change the below line in code:-
toActiveWorkbook.SaveAs (i)
Where path is "C:\Users\DILIPandey\Downloads\" and you need to just change this path to your choice.ActiveWorkbook.SaveAs ("C:\Users\DILIPandey\Downloads\" & i)
Regards,
DILIPandey
<click on below 'star' if this helps>
DILIPandey
+919810929744
dilipandey@gmail.com
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks