Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try the below...Edit the workbooknames ..Assume the workbook is open
Sub Macro() Dim cell As Range, wb As Workbook Set wb = Workbooks("Whichworkbook.xls") Application.DisplayAlerts = False 'Specify the range in which the cities are mentioned... For Each cell In Workbooks("book3.xls").Sheets("Sheet3").Range("A5: A8") If cell.Text < "" Then wb.SaveAs "d:\" & cell.Text & ".xls", xlNormal End If Next Application.DisplayAlerts = True End Sub -- Jacob (MVP - Excel) "Plum" wrote: Hi there, I've got a list of 55 cities, and I'd like a macro to go down the list one by one, and save the file with each city as the file name, so that in the end I have 55 different files, each called city1.xls and city 2.xls and so forth. I'm sure this is possible but not sure where to start! Thanks for your help... |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to Save As Variable File Name | Excel Programming | |||
Save to Path & Variable file name | Excel Programming | |||
Save File to Another Directory, but not change Users File Save location | Excel Programming | |||
Using a variable string in a file save path | Excel Programming |