szakharov7723
Board Regular
- Joined
- Jun 22, 2018
- Messages
- 85
- Office Version
- 2019
- Platform
- Windows
I want to save as my file based on value in cell. This value is date calculated by formula.
In the same time if this file already exists I want to add _2 to file name.
This is what I have so far, but it doesn't work with Formula , neither I know how to add 2nd save as. (Sorry I could not find how to attach file, nor how to insert proper format for code)
Can you please help
Option Explicit
Sub SaveAsExample()
Dim FName As String
Dim FPath As String
FPath = Sheets("Sheet1").Range("A3").Text
FName = Sheets("Sheet1").Range("A5").Text
ThisWorkbook.SaveAs Filename:=FPath & "" & FName
End Sub
In the same time if this file already exists I want to add _2 to file name.
This is what I have so far, but it doesn't work with Formula , neither I know how to add 2nd save as. (Sorry I could not find how to attach file, nor how to insert proper format for code)
Can you please help
Option Explicit
Sub SaveAsExample()
Dim FName As String
Dim FPath As String
FPath = Sheets("Sheet1").Range("A3").Text
FName = Sheets("Sheet1").Range("A5").Text
ThisWorkbook.SaveAs Filename:=FPath & "" & FName
End Sub