View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
khlaudhya khlaudhya is offline
external usenet poster
 
Posts: 9
Default VBA code for Excel File Save As

Hi,

I'm building a code where at some point I need to save the file to a new location with a specific file name, which is also specified by the code. I would like to be prompted for this but it only saves if I specify the path.

This is the bit I have already written and can't go further:

Dim NewName As String

NewName = mRateName & " " & Validade & ".xls"

If MsgBox("Save file as " & NewName & "?", vbYesNo, Save) = vbNo Then

Exit Sub

ActiveWorkbook.SaveAs FileName:=NewName

Can anyone help me?

Thanks