Ananthram.Gupta
New Member
Hello Ninjas,
I have two different workbooks with one master sheet and one template and I would need to populate based on a cell C2 criteria with a button to fetch and then I would need this to export the selected range to a different sheet with the file name as (C2 + today's date). Please check and help me accordingly
For save I am below code in the module.
The code will just export it to the desired location, but I need to select a particular range and then have an export option.
I have two different workbooks with one master sheet and one template and I would need to populate based on a cell C2 criteria with a button to fetch and then I would need this to export the selected range to a different sheet with the file name as (C2 + today's date). Please check and help me accordingly
For save I am below code in the module.
The code will just export it to the desired location, but I need to select a particular range and then have an export option.
Code:
Sub Filename_Cellvalue()
Dim Path As String
Dim filename As String
Path = "E:\Design\jagadish\office\Job 18-03-2019\16-03-2020\test\"
filename = Range("C2")
ActiveWorkbook.SaveAs filename:=Path & filename & Format(Now(), " DD-MMM-YYYY") & ".xlsx", FileFormat:=xlWorkbookDefault
End Sub
Attachments
Last edited: