Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 391
Default HOw do you save a file using a macro?

two possibilities...

1)

Sub SaveFileAs()
Dim sFileName As String
sFileName = Application.GetSaveAsFilename
If sFileName = "False" Then Exit Sub
ActiveWorkbook.SaveAs sFileName
End Sub

2)

Sub SaveFileAs()
Dim sFileName As String
sFileName = InputBox("Enter Name to be saved as...")
If sFileName = "" Then Exit Sub
ActiveWorkbook.SaveAs sFileName
End Sub


just a couple of ideas
you could also add
ActiveWorkbook.Close False
before the End Dub to close the file after saving it.

Patrick Molloy
Microsoft Excel MVP


-----Original Message-----
I'm trying to save a file with a macro. I have 90

different files that
I'm running the same macro on. When it's done I want

the macro to save
it but with a different name.

Right now the code is setting the name of the file to

the first name I
put in (e.g. CMAC301). I want the next file to be named

CMAC302. How
do I do that?

When I had Office 97, I was able to somehow pause the

macro, input data
as I needed and then resume. Is this still available?

HELP!!!!!!!!!!!!!!!!!!!!!!



------------------------------------------------
Message posted from the Excel Tip Forum at

http://www.ExcelTip.com/forum/

-- View and post usenet messages directly from

http://www.ExcelTip.com
-- Hundreds of free MS Excel tips, tricks and solutions
------------------------------------------------
.

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
2007 Macro to Open File, Delete Contents, Save New File Flintstone[_2_] Excel Discussion (Misc queries) 2 February 1st 10 11:25 PM
Allow a macro to save over another file Marie Bayes Excel Discussion (Misc queries) 2 January 10th 07 04:46 PM
Macro Save File (Unique file name) SJC Excel Worksheet Functions 5 October 27th 05 10:09 PM
Macro to save a file as ynissel Excel Discussion (Misc queries) 4 May 26th 05 02:48 PM
Macro to save a file as a PDF ynissel Excel Discussion (Misc queries) 8 May 25th 05 10:46 PM


All times are GMT +1. The time now is 12:01 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"