#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,388
Default SaveAs "Filename"_1

Hi Guys,

I'm looking for a line of code to add into a macro that will save the open
workbook (lets call it workbook1) in the format of

Filename_1 e.g. Workbook_1

I'm sure its simple but I'm having a blank.

Thanks!
Dave
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,856
Default SaveAs "Filename"_1

If you just want to save the workbook with its current name
(overwriting an earlier version), then try this:

Application.DisplayAlerts = False
ActiveWorkbook.Save
Application.DisplayAlerts = True

The Application.DisplayAlerts = False will overwrite without
giving you a warning.

Alternatively, if you want to save the file with a different name,
then try this:

ActiveWorkbook.SaveAs Filename:= _
full_path & "Workbook_1.xls", _
FileFormat:=xlNormal, Password:="", _
WriteResPassword:="", _
ReadOnlyRecommended:=False, _
CreateBackup:=False

Just one statement - I've split it here to avoid awkward line breaks
in the newsgroups.

full_path is a string which you should have declared earlier - fairly
obvious what it is for.

Hope this helps.

Pete

On Jul 24, 10:30 pm, Dave wrote:
Hi Guys,

I'm looking for a line of code to add into a macro that will save the open
workbook (lets call it workbook1) in the format of

Filename_1 e.g. Workbook_1

I'm sure its simple but I'm having a blank.

Thanks!
Dave



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
change "true" and "false" to "availble" and "out of stock" inthestands Excel Worksheet Functions 2 July 19th 07 07:05 PM
Programming "SaveAs" command gfkbob[_2_] Excel Discussion (Misc queries) 0 April 12th 07 04:07 PM
Cell("filename") doesn't update to new filename when do save as. Louis Excel Worksheet Functions 2 March 22nd 07 07:27 PM
HELP on "left","right","find","len","substitute" functions serene83 Excel Discussion (Misc queries) 5 June 27th 06 02:23 AM
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next BCB New Users to Excel 7 May 13th 06 10:02 PM


All times are GMT +1. The time now is 12:13 AM.

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"