Hi I have below code which for the first give me an error and for the second, would really need it to be changed so it start from row 3.
It has columns from A to AQ, The out put for the empty ones should just be comma ,,. Also if possible I would like to have a file prompt, so I can choose where to save the file. Please have a look and also check the test file.
Thanks in advance
Abjac
PS. Use excel 2003
Sub ExportToQuoteWrappedCSV()
Dim FileNum As Integer
Dim myRange As Range
Dim myStr As String
Dim i As Integer
Dim j As Long
FileNum = FreeFile
Set myRange = ActiveCell.CurrentRegion
Set myRange = myRange.Offset(1, 0).Resize(myRange.Rows.Count - 1)
Open ThisWorkbook.Path & "\Output.csv" For Output As #FileNum
'Put out the values
For i = myRange.Cells(1).Row To myRange.Cells(myRange.Cells.Count).Row
myStr = ""
For j = myRange.Cells(1).Column To myRange.Cells(myRange.Cells.Count).Column
myStr = myStr & """" & Cells(i, j).Value & ""","
Next j
Print #FileNum, Left(myStr, Len(myStr) - 1)
Next i
Close #FileNum
End Sub
Bookmarks