Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Create seperate xls files with names based on cell text
Hi,
I've got a summary worksheet where the user inputs all the relevant "input" information. I'd like to create a macro that uses all the information in column B (ie B2 = 1111, B3 = 1112, B4=1113 etc ) and create individual workbooks titled 1111.LC.xls, 1112.LC.xls, 1113.LC.xls etc and have them saved in a directory I:\Invoices\ What is the code i need to accomplish this? Thanks in advance. These newsgroups are great! Troy |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Create seperate xls files with names based on cell text
Sub test()
Const cPath = "I:\Invoices\" Dim wkb As Workbook, i As Long, lngLastRow As Long With ActiveSheet lngLastRow = .Cells(Rows.Count, 2).End(xlUp).Row For i = 2 To lngLastRow Set wkb = Workbooks.Add wkb.SaveAs cPath & .Cells(i, 2).Value wkb.Close Next End With End Sub -- Rob van Gelder - http://www.vangelder.co.nz/excel "TroyB" wrote in message u... Hi, I've got a summary worksheet where the user inputs all the relevant "input" information. I'd like to create a macro that uses all the information in column B (ie B2 = 1111, B3 = 1112, B4=1113 etc ) and create individual workbooks titled 1111.LC.xls, 1112.LC.xls, 1113.LC.xls etc and have them saved in a directory I:\Invoices\ What is the code i need to accomplish this? Thanks in advance. These newsgroups are great! Troy |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to create automated find of common names in seperate columns? | Excel Discussion (Misc queries) | |||
How to create a list of media files names in excel. | Excel Discussion (Misc queries) | |||
Create Cell Comment based on text in a cell on another worksheet | Excel Discussion (Misc queries) | |||
Create formula that will pull a value based on text in diff cell? | Excel Discussion (Misc queries) | |||
create a list of worksheet names (from a single folder, or open files) | Excel Discussion (Misc queries) |