Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 42
Default Saving a workbook

Hi
I am trying to save a newly created workbook, using the value of a cell
as its name.
These cell values are used in the first workbook.

[M24] = C:\Documents and Settings\Memos\ 'Pathway for file
[M19] = Memo1 'file name

Workbooks.Add

Then, I've tried the following without success:

Workbook.SaveAs ([M19] & ".xls")
or
ActiveWorkbook.SaveAs [M19] & ".xls"
or
ActiveWorkbook.SaveAs [M24] & [M19] & ".xls"
or
Workbooks(ActiveWorkbook).SaveAs [M19] & ".xls"

Can someone please help me ?

Thank you
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Saving a workbook


myfilename = "d:\somewhere\" & Range("customer") & "\"
Range("address")
ActiveWorkbook.SaveAs Filename:= _
myfilename, FileFormat _
:=xlNormal, Password:="", _
WriteResPassword:="", ReadOnlyRecommended:= _
False, CreateBackup:=False

"customer" is a named range for a subdirectory
for this to work, the subfolder already has to exist

"address" is a named range for the actual file name

you don't have to used named ranges, but I like to, because its easie
to write formulas and work with code

--
davesexce
-----------------------------------------------------------------------
davesexcel's Profile: http://www.excelforum.com/member.php...fo&userid=3170
View this thread: http://www.excelforum.com/showthread.php?threadid=51664

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 923
Default Saving a workbook

ActiveWorkbook.SaveAs Filename:=Range("M24") & Range("M19") & ".xls"

--
Cheers
Nigel



"Andrew B" wrote in message
...
Hi
I am trying to save a newly created workbook, using the value of a cell
as its name.
These cell values are used in the first workbook.

[M24] = C:\Documents and Settings\Memos\ 'Pathway for file
[M19] = Memo1 'file name

Workbooks.Add

Then, I've tried the following without success:

Workbook.SaveAs ([M19] & ".xls")
or
ActiveWorkbook.SaveAs [M19] & ".xls"
or
ActiveWorkbook.SaveAs [M24] & [M19] & ".xls"
or
Workbooks(ActiveWorkbook).SaveAs [M19] & ".xls"

Can someone please help me ?

Thank you



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 42
Default Saving a workbook

Thank you - it now works.

Andrew B
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
HELP -Saving a workbook jolowe Excel Discussion (Misc queries) 5 September 15th 09 09:58 AM
Color Changes When Saving 2007 Workbook as 97 - 2003 Workbook Don Excel Discussion (Misc queries) 0 April 20th 08 04:51 AM
Saving Workbook Jeff Excel Discussion (Misc queries) 1 March 30th 07 07:57 PM
Saving a sheet in a workbook as .csv but not changing workbook name gloryofbach[_4_] Excel Programming 3 October 30th 05 08:50 PM
Saving a Workbook: Forcing User to Rename before Saving Rollin_Again[_6_] Excel Programming 5 April 16th 04 02:54 PM


All times are GMT +1. The time now is 03:05 PM.

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"