Hey guys,
after the quick help with my last problem, I want to come to you with a new one.
Follwing is the code for a save button.
However it only works properly if pressed once. Now I want to build in some sort of function that should check if a file like the opened one exists already. If not, the function shall be as in the code. If yes, it should just be saved "normally".
Hope it is clear what I want, otherwise please feel free to ask
Cheers
Jan
after the quick help with my last problem, I want to come to you with a new one.
Follwing is the code for a save button.
However it only works properly if pressed once. Now I want to build in some sort of function that should check if a file like the opened one exists already. If not, the function shall be as in the code. If yes, it should just be saved "normally".
Hope it is clear what I want, otherwise please feel free to ask
Cheers
Jan
Code:
Private Sub cmdSave_Click()
If Cells(2, 2) = "" Then MsgBox "Please enter valid Order No. first"
Else: ActiveWorkbook.SaveAs _
Filename:="C:\" & Worksheets("Bondout List").Range("B2").Value _
, FileFormat:=xlNormal, CreateBackup:=False
MsgBox "Saving successful"
Me.cmdSave.Enabled = False
End Sub