Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
saving files
I would like to open a new xls file using the contents of 3 named ranges on
the current worksheet as the name of the new file. The named range "mnf" "lot" and "exp" ie (mnf=john, lot =gh , exp=09022006) I would like to get the file name to be "mnf""lot""exp".xls (ie johngh09022006.xls) Any suggestions? Do i have to open a unnamed file then name it when i save it? ty for any help dr chuck |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
saving files
Yes, you have to do a saveas to rename a file
Dim s as String, bk as Workbook s = Range("mnf").Value & Range("lot").Value & _ Format(Range("exp").Value,"mmddyyyy") & ".xls" set bk = Workbooks.Add() bk.SaveAs Thisworkbook.Path & "\" & s -- Regards, Tom Ogilvy "dr chuck" wrote in message ... I would like to open a new xls file using the contents of 3 named ranges on the current worksheet as the name of the new file. The named range "mnf" "lot" and "exp" ie (mnf=john, lot =gh , exp=09022006) I would like to get the file name to be "mnf""lot""exp".xls (ie johngh09022006.xls) Any suggestions? Do i have to open a unnamed file then name it when i save it? ty for any help dr chuck |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
saving files
thanks Tom,
Your information is always very helpful. Wish I had the working knowledge of this that you do. -- dr chuck "Tom Ogilvy" wrote: Yes, you have to do a saveas to rename a file Dim s as String, bk as Workbook s = Range("mnf").Value & Range("lot").Value & _ Format(Range("exp").Value,"mmddyyyy") & ".xls" set bk = Workbooks.Add() bk.SaveAs Thisworkbook.Path & "\" & s -- Regards, Tom Ogilvy "dr chuck" wrote in message ... I would like to open a new xls file using the contents of 3 named ranges on the current worksheet as the name of the new file. The named range "mnf" "lot" and "exp" ie (mnf=john, lot =gh , exp=09022006) I would like to get the file name to be "mnf""lot""exp".xls (ie johngh09022006.xls) Any suggestions? Do i have to open a unnamed file then name it when i save it? ty for any help dr chuck |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Saving files | Excel Discussion (Misc queries) | |||
Saving files | Excel Discussion (Misc queries) | |||
Closing files and saving files | Excel Worksheet Functions | |||
Saving csv files | Excel Discussion (Misc queries) | |||
Saving files | Excel Programming |