Hi Guy's,
I have been having some help with a code for making a worksheet and saving it automatically in a specific path with a specific filename. However I would now like to add a date field to the file name when the new workbook is opened and saved. The date is in a cell within the sheet already but in dd-mm-yy format, in the file name i would like it in yymmdd format. I have been using a Range("DateDived").Value however this doesn't give the format i want.
Any ideas? See below the example
ActiveWorkbook.SaveAs Filename:=ThisWorkbook.Path & ".\..\B. Target Documentation" & TargetSelection.Value & "\01_Target Report" & Range("ProjectNumber").Value & "_TRR_" & ReportNumber & Range("DateDived").Value & "_" & TargetSelection.Value & ".xlsx"
I have been having some help with a code for making a worksheet and saving it automatically in a specific path with a specific filename. However I would now like to add a date field to the file name when the new workbook is opened and saved. The date is in a cell within the sheet already but in dd-mm-yy format, in the file name i would like it in yymmdd format. I have been using a Range("DateDived").Value however this doesn't give the format i want.
Any ideas? See below the example
ActiveWorkbook.SaveAs Filename:=ThisWorkbook.Path & ".\..\B. Target Documentation" & TargetSelection.Value & "\01_Target Report" & Range("ProjectNumber").Value & "_TRR_" & ReportNumber & Range("DateDived").Value & "_" & TargetSelection.Value & ".xlsx"