Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
dyl dyl is offline
external usenet poster
 
Posts: 1
Default "save as" macro help


I want to create a macro that has "save as" in it and automaticall
fills in the new file name by looking at the contents of a specifi
cell in the file.
Is this possible

--
dy
-----------------------------------------------------------------------
dyl's Profile: http://www.excelforum.com/member.php...fo&userid=2867
View this thread: http://www.excelforum.com/showthread.php?threadid=48345

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default "save as" macro help

Hi Dyl,

Try something like:
'=========
Public Sub Tester()
Dim sStr As String

sStr = ActiveWorkbook.Sheets("Sheet1"). _
Range("A1").Value '<<===== CHANGE
ActiveWorkbook.SaveAs sStr
End Sub
'<<=========

---
Regards,
Norman



"dyl" wrote in message
...

I want to create a macro that has "save as" in it and automatically
fills in the new file name by looking at the contents of a specific
cell in the file.
Is this possible?


--
dyl
------------------------------------------------------------------------
dyl's Profile:
http://www.excelforum.com/member.php...o&userid=28671
View this thread: http://www.excelforum.com/showthread...hreadid=483455



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 180
Default "save as" macro help

Su
Sub test()
Dim FName
FName = Cells(1, 1).Value
ActiveWorkbook.SaveAs Filename:=FName
End Sub


"dyl" wrote:


I want to create a macro that has "save as" in it and automatically
fills in the new file name by looking at the contents of a specific
cell in the file.
Is this possible?


--
dyl
------------------------------------------------------------------------
dyl's Profile: http://www.excelforum.com/member.php...o&userid=28671
View this thread: http://www.excelforum.com/showthread...hreadid=483455


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 325
Default "save as" macro help

Hi, Dyl,

How about this as an example:

Foldername is a cell on the worksheet containing the folder that you want to
save to.
WeekNumber is a cell containing the week number
Year is a cell containing the year

Sub SaveMe() '[Control]+[Shift]+V

Application.DisplayAlerts = False
Set WeekNumber = Sheets("Database").Range("WeekNumber")
Set Year = Sheets("Database").Range("Year")
FolderName = Sheets("Database").Range("FolderName").Value
SaveString = Year.Value & "-" & _
Format(WeekNumber.Value, "00") & " " & "Consolidation.xls"
ActiveWorkbook.SaveAs Filename:=FolderName & SaveString, _
FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
End Sub

This code saves the active workbook in the format 2005-42 Consolidation.xls
where the 2005 and 42 come from cells in the worksheet.
I'm sure you can adapt this to your requirements.

Regards

Pete



"dyl" wrote:


I want to create a macro that has "save as" in it and automatically
fills in the new file name by looking at the contents of a specific
cell in the file.
Is this possible?


--
dyl
------------------------------------------------------------------------
dyl's Profile: http://www.excelforum.com/member.php...o&userid=28671
View this thread: http://www.excelforum.com/showthread...hreadid=483455


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 469
Default "save as" macro help

trying to save a workbook & all sheets useing file save as. missing something
useing following..
Answer = MsgBox(" Have you made a backup of this data?", vbYesNo)
If Answer = vbNo Then
fileSaveName = Application.GetSaveAsFilename( _
fileFilter:="Text Files (*.txt), *.txt")
If fileSaveName < False Then
MsgBox "Save as " & fileSaveName
End If
when it runs it does not save? it does bring up save as box
duu lost Thanks
"Peter Rooney" wrote:

Hi, Dyl,

How about this as an example:

Foldername is a cell on the worksheet containing the folder that you want to
save to.
WeekNumber is a cell containing the week number
Year is a cell containing the year

Sub SaveMe() '[Control]+[Shift]+V

Application.DisplayAlerts = False
Set WeekNumber = Sheets("Database").Range("WeekNumber")
Set Year = Sheets("Database").Range("Year")
FolderName = Sheets("Database").Range("FolderName").Value
SaveString = Year.Value & "-" & _
Format(WeekNumber.Value, "00") & " " & "Consolidation.xls"
ActiveWorkbook.SaveAs Filename:=FolderName & SaveString, _
FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
End Sub

This code saves the active workbook in the format 2005-42 Consolidation.xls
where the 2005 and 42 come from cells in the worksheet.
I'm sure you can adapt this to your requirements.

Regards

Pete



"dyl" wrote:


I want to create a macro that has "save as" in it and automatically
fills in the new file name by looking at the contents of a specific
cell in the file.
Is this possible?


--
dyl
------------------------------------------------------------------------
dyl's Profile: http://www.excelforum.com/member.php...o&userid=28671
View this thread: http://www.excelforum.com/showthread...hreadid=483455




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 469
Default "save as" macro help

want to use a macro to save and user input fname if ready to save othewise I
have it go pass to do other function. got the go pass but don't get the save
when looking where it was to go.??
missing something. Used normal macro record to generate code. code as follows
Answer = MsgBox(" Have you made a backup of this data?", vbYesNo)
If Answer = vbNo Then
fileSaveName = Application.GetSaveAsFilename( _
fileFilter:="Text Files (*.txt), *.txt")
If fileSaveName < False Then
MsgBox "Save as " & fileSaveName
End If
got me right now can't see it.
any help Thanks
"Peter Rooney" wrote:

Hi, Dyl,

How about this as an example:

Foldername is a cell on the worksheet containing the folder that you want to
save to.
WeekNumber is a cell containing the week number
Year is a cell containing the year

Sub SaveMe() '[Control]+[Shift]+V

Application.DisplayAlerts = False
Set WeekNumber = Sheets("Database").Range("WeekNumber")
Set Year = Sheets("Database").Range("Year")
FolderName = Sheets("Database").Range("FolderName").Value
SaveString = Year.Value & "-" & _
Format(WeekNumber.Value, "00") & " " & "Consolidation.xls"
ActiveWorkbook.SaveAs Filename:=FolderName & SaveString, _
FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
End Sub

This code saves the active workbook in the format 2005-42 Consolidation.xls
where the 2005 and 42 come from cells in the worksheet.
I'm sure you can adapt this to your requirements.

Regards

Pete



"dyl" wrote:


I want to create a macro that has "save as" in it and automatically
fills in the new file name by looking at the contents of a specific
cell in the file.
Is this possible?


--
dyl
------------------------------------------------------------------------
dyl's Profile: http://www.excelforum.com/member.php...o&userid=28671
View this thread: http://www.excelforum.com/showthread...hreadid=483455


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
Selecting "Save As" adds "Copy of" to file name- MS Excel 2007 ronhansen Excel Discussion (Misc queries) 1 November 15th 09 09:33 PM
"CELL("FILENAME") NOT UPDATE AFTER "SAVE AS" ACTION yossie6 Excel Discussion (Misc queries) 1 June 16th 08 12:16 PM
"Save" and "Save As" options greyed out - "Save as Webpage" option Bill Excel Discussion (Misc queries) 0 January 16th 07 04:47 PM
"Subscript out of range" error for: Workbooks("Test1.xls").Save Just12341234 Excel Programming 2 June 17th 05 03:16 PM
save and restore "Workbook Menu Bar" & "Cell" menus Jeff Higgins Excel Programming 2 February 14th 05 01:33 AM


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