View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
BEEJAY BEEJAY is offline
external usenet poster
 
Posts: 247
Default Auto Add to WB saved Name

Works Great. Thanks so much


"Ron de Bruin" wrote:

Try this

NewName = OldPath & Left(OldName, Len(OldName) - 4) & "_DONE.xls"


--
Regards Ron de Bruin
http://www.rondebruin.nl



"BEEJAY" wrote in message ...
Have been trying for some time to determine how to add to a currently saved
workbook name. This is to indicate that the workbook in question has been
processed by the VB Programming.
I have used the following successfully, but so far have not been able to get
the extra added on the end of the name: eg: File name XYZ.XLS becomes
XYZ_Done.xls. I understand that I have to use the dot as a reference point,
since the actual workbook name could be any length (number of characters)
Any suggestions would be appreciated.

Dim OldName As String
Dim OldPath As String
Dim NewName As String

OldPath = ActiveWorkbook.Path & "\"
OldName = ActiveWorkbook.Name

NewName = "DONE_" + OldName

ActiveWorkbook.SaveAs NewName