Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 226
Default Save file as Cell Value

Hi Everyone,

I have the below routine set to copy a page to my desktop. Is there a way
to have it change the save name to a particular cell's value? If Range(€śL6€ť)
equals a certain word, I would like it to save as that particular name.

Thanks in advance for your thoughts - Roger

Sub Finalstop()

ActiveSheet.Copy
ChDir "C:\Documents and Settings\Roger\Desktop"
ActiveWorkbook.SaveAs Filename:= _
"C:\Documents and Settings\Roger\Desktop\New File.xls", FileFormat:= _
xlNormal, Password:="", WriteResPassword:="",
ReadOnlyRecommended:=False _
, CreateBackup:=False
ActiveWorkbook.Close

End

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,942
Default Save file as Cell Value

hi
this might work...
Dim mypath As String
Dim nrng As Range
Dim fname As String
Set nrng = Range("A1")
mypath = "C:\your\file\path\"
fname = nrng.Value & ".xls"
ActiveWorkbook.SaveAs Filename:= _
mypath & fname, FileFormat:= _
xlNormal, Password:="", _
WriteResPassword:="", _
ReadOnlyRecommended:=False, _
CreateBackup:=False

regards
FSt1

"Roger" wrote:

Hi Everyone,

I have the below routine set to copy a page to my desktop. Is there a way
to have it change the save name to a particular cell's value? If Range(€śL6€ť)
equals a certain word, I would like it to save as that particular name.

Thanks in advance for your thoughts - Roger

Sub Finalstop()

ActiveSheet.Copy
ChDir "C:\Documents and Settings\Roger\Desktop"
ActiveWorkbook.SaveAs Filename:= _
"C:\Documents and Settings\Roger\Desktop\New File.xls", FileFormat:= _
xlNormal, Password:="", WriteResPassword:="",
ReadOnlyRecommended:=False _
, CreateBackup:=False
ActiveWorkbook.Close

End

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 226
Default Save file as Cell Value

Your idea worked great.

Thanks so much for all your help.

Roger


"FSt1" wrote:

hi
this might work...
Dim mypath As String
Dim nrng As Range
Dim fname As String
Set nrng = Range("A1")
mypath = "C:\your\file\path\"
fname = nrng.Value & ".xls"
ActiveWorkbook.SaveAs Filename:= _
mypath & fname, FileFormat:= _
xlNormal, Password:="", _
WriteResPassword:="", _
ReadOnlyRecommended:=False, _
CreateBackup:=False

regards
FSt1

"Roger" wrote:

Hi Everyone,

I have the below routine set to copy a page to my desktop. Is there a way
to have it change the save name to a particular cell's value? If Range(€śL6€ť)
equals a certain word, I would like it to save as that particular name.

Thanks in advance for your thoughts - Roger

Sub Finalstop()

ActiveSheet.Copy
ChDir "C:\Documents and Settings\Roger\Desktop"
ActiveWorkbook.SaveAs Filename:= _
"C:\Documents and Settings\Roger\Desktop\New File.xls", FileFormat:= _
xlNormal, Password:="", WriteResPassword:="",
ReadOnlyRecommended:=False _
, CreateBackup:=False
ActiveWorkbook.Close

End

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
Autoname a save as file from a cell in a read only file g4rod Excel Discussion (Misc queries) 2 October 6th 06 01:16 PM
Save file with cell name Brian Thompson via OfficeKB.com New Users to Excel 7 January 18th 06 09:11 PM
Using "Save As" with a file name selected by cell B Baggins Excel Discussion (Misc queries) 1 September 24th 05 02:07 PM
Save file as text from cell jweasl Excel Discussion (Misc queries) 1 September 9th 05 06:39 PM
Save a new file with the name that is in cell "C7" lunker55 Excel Discussion (Misc queries) 2 May 13th 05 04:57 PM


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