I have been working in a code to paste the data from the vba file to another file. The name of the file which i paste the data is always "endofdaydividends" and i need to save this file everyday in the same place and replace the old one. I would like to save in my desktop.
Sub move_to_csvfile()
Dim x As Workbook
Dim y As Workbook
Dim strPath As String
Dim fileName As String
Dim dd As String
Set x = ThisWorkbook
Set y = Workbooks.Open("T:\CTG\EDM\Current EDM LDN\MacroEODDividend\endofdaydividends.csv")
Application.DisplayAlerts = False
x.Sheets("Code").Range("A:F").EntireColumn.Copy
Application.DisplayAlerts = True
Application.DisplayAlerts = False
y.Sheets("endofdaydividends").Range("A1").PasteSpecial
Application.DisplayAlerts = True
x.Close False
ActiveWorkbook.Save
End Sub
With this code, i close the macro file and leave opened only the "endofdaydividends" file. Does anyone know how to add a command to save it on my folder? I need to save in this address
T:\CTG\EDM\Current EDM LDN\MacroEODDividend\endofdaydividends.csv