I am trying to copy paste into a new workbook, then save that workbook as a CSV file with a number in cell J1 followed by today's date. I have the following code. It is working with but saving it as "& ThisFile & DateStr" instead of the number in Cell J1 and today's date.
Any help or advice would be greatly appreciated.
Thanks
Luke
VBA Code:
Sub NewBook()
Range("A2:F200").Select
Selection.Copy
Workbooks.Add
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Dim ThisFile
Dim DateStr
ThisFile = Range("J1").Value
DateStr = Format(Date, "dd-mm-yyyy")
ActiveWorkbook.SaveAs Filename:= _
"C:\Users\TOM\Documents\Company\Temp\& ThisFile & DateStr.csv", FileFormat:= _
xlCSV, CreateBackup:=False
Range("J10").Select
End Sub
Any help or advice would be greatly appreciated.
Thanks
Luke