Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 683
Default writing a macro to save a workbook

I have a workbook with a macro that save the workbook, however i want the
macro to save it as the same file name as data that was entered into a
certain cell or cells pural if able to
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,510
Default writing a macro to save a workbook

Hi Brian,

Something like this:-

Sub Create_File_Save()
Dim strPath As String
Dim strMyFileName As String

strPath = CurDir & "\" 'Ensure backslash on end of path

'Code uses Current Directory as path.
'Can create path as follows:-
'strPath = "C:\Documents\MyName\"


With Sheets("Sheet1")
'Insert more ambersands and ranges if required
strMyFileName = .Range("A1") & .Range("B1") & ".xls"

'If spaces required in filename the use this option
'strMyFileName = .Range("A1") & " " & .Range("B1") & ".xls"
End With


strMyFileName = strPath & strMyFileName

ActiveWorkbook.SaveAs Filename:=strMyFileName

End Sub

--
Regards,

OssieMac


"Brian" wrote:

I have a workbook with a macro that save the workbook, however i want the
macro to save it as the same file name as data that was entered into a
certain cell or cells pural if able to

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default writing a macro to save a workbook

Check your other post, too.

Brian wrote:

I have a workbook with a macro that save the workbook, however i want the
macro to save it as the same file name as data that was entered into a
certain cell or cells pural if able to


--

Dave Peterson
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
Macro to save excel sheet in a workbook [email protected] Excel Discussion (Misc queries) 1 March 7th 07 02:37 PM
save workbook as current date using a macro ExcelJon Excel Discussion (Misc queries) 2 June 21st 06 03:05 AM
Run Macro(save workbook) after cell updated titch New Users to Excel 3 February 5th 06 07:55 PM
Macro: Exit active workbook without save? Don Excel Worksheet Functions 0 May 20th 05 06:47 AM
Macro in Excel 2002 to save a workbook to a FTP location Lloyd Excel Discussion (Misc queries) 0 December 21st 04 02:49 PM


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