WebFeb 23, 2024 · Dim fileName As String. Dim filePath As String. 'Get the file path and name of the active workbook. filePath = ThisWorkbook.path. fileName = ThisWorkbook.Name. 'Remove the file extension from the file name. fileName = Left (fileName, InStrRev (fileName, ".") - 1) 'Construct the PDF file name including the contents of cells "B3-B2 … WebMar 27, 2024 · Copy and paste the following VBA code on the module. Sub SaveFile_1 () Dim File_Name As String File_Name = "Exceldemy_1" ActiveWorkbook.SaveAs FileName:=File_Name End Sub. Here, notice the file name specified in the code. Now, run the code by pressing the F5 button. We can see the name has changed.
excel - VBA Code to Save As .XLSM - Stack Overflow
WebJul 9, 2024 · VBA Code to Save As .XLSM. Private Sub cmdSaveForm1_Click () Dim strFolder As String Dim i As Long 'Find the position of the period in the file name i = InStr (ActiveWorkbook.Name, ".") 'Create a default file name by concatenating the file name without the extention _ plus the current date and time, and plus the xlsm extention … WebApr 30, 2014 · Here is my final version. Thanks so much. Code: Sub SaveAsDialog () Dim strFolder As String Dim i As Long 'Find the position of the period in the file name i = InStr (ActiveWorkbook.Name, ".") 'Create a default file name by concatenating the file name without the extention _ plus the current date and time, and plus the xlsx extention … dawon corp
Open "File SaveAs" dialog box to save active worksheet as PDF
WebSub GetFileName() Dim BackSlash As Integer, Point As Integer Dim FilePath As String, FileName As String Dim i As Integer FilePath = ActiveWorkbook.FullName For i = … WebFeb 23, 2024 · Sub 名前を付けて保存で拡張子に設定() Dim FileName As String Dim FindPos As Long Dim Done As Variant '拡張子を除くファイル名を取得 FindPos = … WebThe solution is:.FilterIndex = 2 1 = xlsx, 2 = xlsm Private Sub cmdSaveForm1_Click() Dim strFolder As String Dim i As Long 'Find the position of the period in the file name i = InStr(ActiveWorkbook.Name, ".") 'Create a default file name by concatenating the file name without the extention _ plus the current date and time, and plus the xlsm extention … dawond pickney mma