automatic file name
Hi
I have one problem with excel:
my data are beeing colected real time and from time to time I want to
backup them. I made such thing:
Dim ff as Integer
ff = FileFree()
Lastrecord = 1000
FirstCol = 1
LastCol = 5
Open "C:\arch\backup.txt" For Append as ff
for r = 5 to Lastrecord
for C = FirstCol To LastCol
if C=1 Then
Print #ff, Format(Cells(r,C), "yyyy-mm-dd") &
vbTab;
Elseif C = 2 Then
Print #ff, Format(Cells(r,C), "hh:mm:ss") & vbTab;
Else
Print #ff, Cells(r,C) & vbTab;
End if
Next C
Print #ff;
Next r
Close ff
The only thing is how to force excel that each time Export procudure is
call the name of the file (backup.txt) different?! :)
thanks for help ;)
|