#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 162
Default SaveAs Code

What is the correct code to save the current workbook (Book1.xls) as
(Book1A.xls)

Thanks for the help.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default SaveAs Code

Hi Ronbo,

Try this:

' Get the filename with path
sName = ThisWorkbook.FullName
' Add an 'A' to the end of the filename
sName = Left(sName, Len(sName) - 4) & "A.xls"
'Save under new name
ThisWorkbook.SaveAs sName

Hoop This Helps,


Executor

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 162
Default SaveAs Code

Thanks. Exactly what I was looking for.

"Executor" wrote:

Hi Ronbo,

Try this:

' Get the filename with path
sName = ThisWorkbook.FullName
' Add an 'A' to the end of the filename
sName = Left(sName, Len(sName) - 4) & "A.xls"
'Save under new name
ThisWorkbook.SaveAs sName

Hoop This Helps,


Executor


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
SAveAs executes combobox code Alan Lyall Excel Programming 3 June 9th 04 12:52 AM
More help with SaveAs Glen Mettler[_2_] Excel Programming 2 February 14th 04 02:50 AM
Help with SaveAs Glen Mettler[_2_] Excel Programming 1 January 29th 04 05:32 PM
SaveAs Bill[_19_] Excel Programming 1 January 27th 04 11:11 PM
URGENT - Need date format for SaveAs code Ed[_9_] Excel Programming 4 November 6th 03 08:48 PM


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