Merging Cells in Excel Using VB.NET
-
Hi, i want to merge 2 cells in excel when i am importing data from datagrid to cells. how can i do that .please send me a reply. Thanks and Regards Anu jose
Can you show an example of the code you are using to export data to excel? Steve
-
Can you show an example of the code you are using to export data to excel? Steve
Hi, i am using like this Dim XlApp As Excel.Application Dim XlBk As Excel.Workbook Dim XlSht As Excel.Worksheet Dim r As Excel.Range XlApp = CreateObject("Excel.Application") XlBk = XlApp.Workbooks.Add XlSht = XlBk.Worksheets(1) XlApp.Visible = True XlApp.Cells(1, 2).Font.Name = "Arial" XlApp.Cells(1,2).Font.Bold = True XlApp.Cells(1, 2).Font.Size = 9 XlApp.Cells(1, 2).value = "Mode Of Shipment" r = XlApp.Cells(1, 2) r.ColumnWidth = "Mode Of Shipment".ToString.Length * 1.5 XlApp.Cells(2, 2).Font.Name = "Arial" XlApp.Cells(2, 2).Font.Bold = False XlApp.Cells(2, 2).Font.Size = 9 XlApp.Cells(2, 2).value = DtGenReport.Rows(0)("Item"). if the heading is large i want to merge 2 cells. Thanks and Rgards Anu