Private Sub btnExportData_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExportData.Click Dim StrExport As String = "" For Each C As DataGridViewColumn In DataGridView1.Columns StrExport &= """" & C.HeaderText & """," Next StrExport = StrExport.Substring(0, StrExport.Length - 1) StrExport &= Environment.NewLine For Each R As DataGridViewRow In DataGridView1.Rows For Each C As DataGridViewCell In R.Cells If Not C.Value Is Nothing Then StrExport &= """" & C.Value.ToString & """," Else StrExport &= """" & "" & """," End If Next StrExport = StrExport.Substring(0, StrExport.Length - 1) StrExport &= Environment.NewLine Next Dim tw As IO.TextWriter = New IO.StreamWriter("C:\Test1.CSV") tw.Write(StrExport) tw.Close()End Sub <code>