HI All,
Could you be so kind and help me with this VBA code. The macro is working perfectly and does what needs to be done apart from saving a file in CSV but I would like to save it in XLSX, please? . If I change this:
"Open ThisWorkbook.Path & "\FilenameABC.csv" For Output As #F" to "Open ThisWorkbook.Path & "\FilenameABC.xlsx" For Output As #F" won't be able to open the saved file. Thank you for your help
Sub Demo1()
Dim F%, Rw As Range
F = FreeFile
Open ThisWorkbook.Path & "\FilenameABC.csv" For Output As #F
With Application
For Each Rw In ActiveSheet.UsedRange.Columns("B:AZ").Rows
If (Rw.Cells.Count - .CountBlank(Rw)) > 1 Then Print #F, Join(.Index(Rw.Value2, 1, 0), ",")
Next
End With
Close #F
End Sub
Could you be so kind and help me with this VBA code. The macro is working perfectly and does what needs to be done apart from saving a file in CSV but I would like to save it in XLSX, please? . If I change this:
"Open ThisWorkbook.Path & "\FilenameABC.csv" For Output As #F" to "Open ThisWorkbook.Path & "\FilenameABC.xlsx" For Output As #F" won't be able to open the saved file. Thank you for your help
Sub Demo1()
Dim F%, Rw As Range
F = FreeFile
Open ThisWorkbook.Path & "\FilenameABC.csv" For Output As #F
With Application
For Each Rw In ActiveSheet.UsedRange.Columns("B:AZ").Rows
If (Rw.Cells.Count - .CountBlank(Rw)) > 1 Then Print #F, Join(.Index(Rw.Value2, 1, 0), ",")
Next
End With
Close #F
End Sub