AdamCavco
06-12-2024, 11:22 AM
' Get the filename from a specific cell, for example, cell A1
CellValue = ThisWorkbook.Sheets("FORM").Range("D14" & "-" & "E8").Value (<--------THIS ONE)
' Combine folder path and cell value as the file name
FileName = CellValue & ".xlsm"
' Combine folder path and file name
FilePath = FilePath & FileName
' Save the active workbook with the specified file path
ThisWorkbook.SaveAs FilePath
This code is supposed to take two values from the excel spreadsheet and place them in the name of the newly saved file.
I am getting an error from the code above where it says THIS ONE
The file will be named NAME-20240612.xlsm
Can anyone help... Thanks Adam
CellValue = ThisWorkbook.Sheets("FORM").Range("D14" & "-" & "E8").Value (<--------THIS ONE)
' Combine folder path and cell value as the file name
FileName = CellValue & ".xlsm"
' Combine folder path and file name
FilePath = FilePath & FileName
' Save the active workbook with the specified file path
ThisWorkbook.SaveAs FilePath
This code is supposed to take two values from the excel spreadsheet and place them in the name of the newly saved file.
I am getting an error from the code above where it says THIS ONE
The file will be named NAME-20240612.xlsm
Can anyone help... Thanks Adam