I also see the file with separator;
I am attaching the code
'Salva molecolari
ActiveWorkbook.RefreshAll
nomefile = Format(Date, "yyyymmdd") + "_" + Format(Time, "hhmm") + "_MOLECOLARI" + ".csv"
ActiveWorkbook.RefreshAll
Sheets("MOLECOLARI").Select
Sheets("MOLECOLARI").Copy
'****************************************
Dim srcRng As Range
Dim rRow As Range
Dim rCell As Range
Dim sStr As String
Dim FName As Variant
Const sSeparatoreVoluto As String = ";"
FName = Application.GetSaveAsFilename(nomefile, "CSV File (\*.csv), \*.csv")
If FName <> False Then
If Selection.Cells.Count > 1 Then
Set srcRng = Selection
Else
Set srcRng = ActiveSheet.UsedRange
End If
Open FName For Output As #1
For Each rRow In srcRng.Rows
sStr = ""
For Each rCell In rRow.Cells
sStr = sStr & """" & rCell.Value & """" & sSeparatoreVoluto
Next
While Right(sStr, 1) = sSeparatoreVoluto
sStr = Left(sStr, Len(sStr) - 1)
Wend
Print #1, sStr
Next
Close #1
End If
ActiveWorkbook.SaveAs Filename:= _
**"C:\Users\test\_screening\Documents\TAMPONI\" & nomefile, FileFormat:= \_**
xlCSV, Local:=False, CreateBackup:=False
ActiveWorkbook.Close SaveChanges:=True
I already save the file in the right directory, but then the macro stops to ask for the file name again
by
gianmario