View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jim Thomlinson Jim Thomlinson is offline
external usenet poster
 
Posts: 5,939
Default Save as filename

You can give this a try...

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Dim strFileName As String
Dim lngLastSlash As Long
If SaveAsUI = True Then
Cancel = True
strFileName = Application.GetSaveAsFilename
lngLastSlash = InStrRev(strFileName, "\")
strFileName = Left(strFileName, lngLastSlash) & "Z" &
Mid(strFileName, lngLastSlash + 1, 256)
ThisWorkbook.SaveAs strFileName
End If
End Sub
--
HTH...

Jim Thomlinson


"Mike H" wrote:

I have a workbook that is read only so can't be saved. When the users does
'save as' how can I add a letter to the beginning of whatever filename he
chooses. It will be the same letter each time.

M