sunrunner4kr
Registered User.
- Local time
- Today, 16:12
- Joined
- Apr 24, 2008
- Messages
- 16
Hi,
I want at a click of a button, to copy a file and rename it with Todays date.
C:\FILES\ALLOC.csv
C:\FILES\ALLOC191109.csv
I've got the FILECOPY code working:
Private Sub rename_Click()
FileCopy "C:\FILES\ALLOC.CSV", "C:\FILES\ALLOC191109.csv"
End Sub
but I've tried adding the date, and I'm not sure where I'm going wrong.
Private Sub rename_Click()
Dim NewName As String
NewName = "C:\FILES\ALLOC" & Date & ".CSV"
FileCopy "C:\FILES\ALLOC.CSV", NewName
End Sub
Any help would be greatly appreciated. Thanks.
I want at a click of a button, to copy a file and rename it with Todays date.
C:\FILES\ALLOC.csv
C:\FILES\ALLOC191109.csv
I've got the FILECOPY code working:
Private Sub rename_Click()
FileCopy "C:\FILES\ALLOC.CSV", "C:\FILES\ALLOC191109.csv"
End Sub
but I've tried adding the date, and I'm not sure where I'm going wrong.
Private Sub rename_Click()
Dim NewName As String
NewName = "C:\FILES\ALLOC" & Date & ".CSV"
FileCopy "C:\FILES\ALLOC.CSV", NewName
End Sub
Any help would be greatly appreciated. Thanks.