0

I want to enter the data manually in a excel file and generate the below CSV File format. Problem is I entered the data in 11 rows(Excel). First row has 10 columns. Second row has 15 columns. Last row has 4 columns. Some columns can have empty data also. When i save the file as csv file first line and last line has 15 columns. How can i generated the csv file. what i need to do to include the empty columns in the csv file

H,TEST_w99999999999_f101203001,03/12/2010,02:45:28,MIS,MISC,MIS,NEW,, D,,0027940622,,,MISC,030100059566901-000000452312108,MIS,03/12/2010,,,1,57.25,, D,,0027940622,,,MISC,030100059566901-000000452312109,MIS,03/12/2010,,,1,56.00,, D,,2000003318,,,MISC,030200059566901-000000452308586,MIS,03/12/2010,,,1,0.92,, D,,2000004473,,,MISC,030300059566901-000000452176305,MIS,03/12/2010,,,1,-0.45,, D,,2000004439,,,MISC,030300059566901-000000452243016,MIS,03/12/2010,,,1,-38.28,, D,,2000003460,,,MISC,030300059566901-000000452251974,MIS,03/12/2010,,,1,-267.77,, D,,2000006846,,,MISC,030300059566901-000000452300634,MIS,03/12/2010,,,1,-0.05,, D,,2000006846,,,MISC,030300059566901-000000452300636,MIS,03/12/2010,,,1,0.05,, D,,2000004059,,,MISC,030300059576013-000000452317628,MIS,03/12/2010,,,1,272.50,, T,TEST_w99999999999_f101203001,9,80.17

1
  • can anyonepls respond to my query Commented Dec 30, 2010 at 4:50

1 Answer 1

1
   Sub SaveAsCSV()
      ActiveWorkbook.SaveAs Filename:= _
          "C:\NewCsvDile.csv", FileFormat:=xlCSV, _
           CreateBackup:=False
   End Sub
Sign up to request clarification or add additional context in comments.

4 Comments

Header and tail records have different number of columns. How can i resolve it.
Just save it as a "CSV (comma delimited) (*.csv)." type. You'll only have as many columns per row as you have data. Empty cells between columns will also be respected. Can you post a screenshot of the excel file you are filling?
Thanks a lot for the info. I am not sure how i can paste screen scot here. Only text box is available.
Nice to hear it helped. To insert pictures in a post, use the 6th icon from the left. The one that looks like a polaroid picture.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.