Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default 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
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 to create automated find of common names in seperate columns? Exceldummy Excel Discussion (Misc queries) 0 July 22nd 09 06:45 AM
How to create a list of media files names in excel. joye68 Excel Discussion (Misc queries) 2 July 9th 07 05:12 AM
Create Cell Comment based on text in a cell on another worksheet Dave Fellman Excel Discussion (Misc queries) 2 March 15th 07 09:49 AM
Create formula that will pull a value based on text in diff cell? So Tru Geo Excel Discussion (Misc queries) 0 June 22nd 06 08:16 PM
create a list of worksheet names (from a single folder, or open files) Drew Excel Discussion (Misc queries) 2 April 15th 05 04:58 PM


All times are GMT +1. The time now is 10:20 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"