Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!
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.
|find and replace in column A across 75 csv books||8||31|
|where can i download QDE (Quick Date Entry) add-in for Excel?||4||23|
|Embed XL WS and Objects into a PPTX||8||34|
|Records being deleted when Condition Not Met||30||28|
Join the community of 500,000 technology professionals and ask your questions.