LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
SJC
 
Posts: n/a
Default Macro Save File (Unique file name)

I currently have a code which I have listed below which will save a file when
the user selects the button. I have some users who will need to save two or
more files, which directs them to overwrite the file since currently, there
is no identifier in the file name. The indentifier that I would like to add
is on another spreadsheet in the same workbook. (Worksheet name:
Intro--Start Here; cell: G13)

Does anyone know how I can add this information to the filename so that each
file saved will have a unique name? Thanks for any suggestions.


Dim strPath As String
Dim strFileName As String

strPath = Application.DefaultFilePath & "\"
strFileName = "xxx"

ActiveWorkbook.SaveAs strPath & strFileName, FileFormat:= _
xlNormal, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False _
, CreateBackup:=False
ActiveWindow.Close
Sheets("Intro--Start Here").Select
MsgBox ("xxx")

End Sub
 
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
Defining a Cell for Save as file name psasales Excel Discussion (Misc queries) 0 September 21st 05 06:51 PM
save original data after macro is run again MINAL ZUNKE New Users to Excel 3 July 7th 05 12:48 PM
Macro excel save mrbalaje Excel Discussion (Misc queries) 1 May 12th 05 06:27 PM
Opening a file with a Macro Adam1 Chicago Excel Discussion (Misc queries) 2 February 28th 05 10:13 PM
Save & Save As features in file menu of Excel Blue Excel Discussion (Misc queries) 9 December 27th 04 08:49 PM


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