salve,
nel codice che segue ho provato ad inserire il time stamp ma senza successo.
Sub CREAFILE()
Dim cFile As String, cPath As String, I As Long, J As Long, myRow As String
Dim myF As Long
'
cPath = "C:\xxx\" '<<< La directory in cui su creeranno i txt, con \ finale
Close #1
For I = 2 To Cells(Rows.Count, "B").End(xlUp).Row
If Cells(I, 2) & "" <> cFile Then
Close #1: myF = myF + 1
cFile = Cells(I, 2)
Open cPath & cFile & ".txt" For Output As #1
End If
myRow = ""
For J = 1 To Cells(I, Columns.Count).End(xlToLeft).Column
myRow = myRow & Cells(I, J) & Chr(9)
Next J
Print #1, Left(myRow, Len(myRow) - 1)
Next I
Close #1
MsgBox ("Compilati " & myF & " file(s)")
End Sub
credo di dover inserire
aName = Replace(aName, "." & mySplit(UBound(mySplit, 1)), "_" & Format(Now, "yyyy-mm-dd_hh-mm-ss") & "." & mySplit(UBound(mySplit, 1)))
oppure
Fname = "GLS." & Format(date, "yyyy-mm-dd") & ".Ctr_" & Format(time, "HHmm") & ".txt"
ma non ricordo come e dove.
grazie per l'aiuto
Buni