Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Merging Cells in Excel Using VB.NET

Merging Cells in Excel Using VB.NET

Scheduled Pinned Locked Moved Visual Basic
csharpquestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    anujose
    wrote on last edited by
    #1

    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

    S 1 Reply Last reply
    0
    • A anujose

      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

      S Offline
      S Offline
      Stephen McGuire
      wrote on last edited by
      #2

      Can you show an example of the code you are using to export data to excel? Steve

      A 1 Reply Last reply
      0
      • S Stephen McGuire

        Can you show an example of the code you are using to export data to excel? Steve

        A Offline
        A Offline
        anujose
        wrote on last edited by
        #3

        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

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups