Inf
unread,Jun 1, 2023, 10:57:36 AM6/1/23You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
Buon pomeriggio a tutti,
uso questo codice VBA per creare file csv/txt
Sub File_CSV()
Dim NomeFile As String
Dim TotDati As Long, RigEnd As Long
Dim ColIni As Byte, RigIni As Byte, ColEnd As Byte, i As Byte
Dim y As Long
Dim Valore
NomeFile = "Z:\Fatture.csv"
TotDati = Application.WorksheetFunction.CountA(Worksheets("Fatture").Range("A:A"))
Worksheets("Fatture").Activate
ColIni = 1
RigIni = 1
ColEnd = 4
RigEnd = TotDati
Open NomeFile For Output As #1
For y = RigIni To RigEnd
For i = ColIni To ColEnd
Valore = Cells(y, i).Value
If i = ColEnd Then
Valore = Valore & vbCrLf 'Chr(13)
Else
Valore = Valore & ";"
End If
Print #1, Valore;
Next i
Next y
Close #1
End Sub
(non uso appositamente file/salva/ CSV UTF-8 (delimitato dalla virgole) (*.csv)
purtroppo il valore 1.011,10 lo esporta come 1011,1 ovvero privo dello zero decimale;
sapreste indicarmi come "mantenerlo"?
Cordialità.
Maurizio