On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.
Option Explicit Sub export2csv() Dim lastColumn As Integer Dim lastRow As Integer Dim strString As String Dim i As Integer, j As Integer lastColumn = ActiveSheet.UsedRange.Column - 1 + ActiveSheet.UsedRange.Columns.Count lastRow = ActiveSheet.UsedRange.Rows(ActiveSheet.UsedRange.Rows.Count).Row Open "export.csv" For Output As #1 For i = 1 To lastRow Cells(i, 1).Select strString = "" For j = 1 To lastColumn If j <> lastColumn Then strString = strString & Cells(i, j).Value & ";" ' Use semicolon instead of pipe. Else strString = strString & Cells(i, j).Value End If Next j Print #1, strString Next i Close #1 End Sub
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.