title: Top border is missing in some of the columns in excel report using vb.net
body: <p>I am generating an excel report using vb.net. Some of the borders are missing in the report. Top border of E32 F32,G32 H32 is missing and right of H32 is missing.Below is my code. Even top right of B32 is missing.<a href="https://i.stack.imgur.com/upZPV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/upZPV.png" alt="enter image description here"></a></p>
  
  <pre><code>      With oSheet.Range("E" &amp; count)
              .Merge()
              .HorizontalAlignment = XlHAlign.xlHAlignCenter
              .VerticalAlignment = XlHAlign.xlHAlignCenter
              .Borders.Weight = XlBorderWeight.xlThin
              .Value = "For the month"
              .Font.Bold = True
              .ColumnWidth = 20
  
          End With
          oSheet.Range("E36:F36").Merge()
          With oSheet.Range("E" &amp; count + 1)
              .HorizontalAlignment = XlHAlign.xlHAlignCenter
              .VerticalAlignment = XlHAlign.xlHAlignCenter
              .Borders.Weight = XlBorderWeight.xlThin
              .Font.Bold = True
              .ColumnWidth = 20
  
          End With
  
          With oSheet.Range("G" &amp; count)
              .Merge()
              .HorizontalAlignment = XlHAlign.xlHAlignCenter
              .VerticalAlignment = XlHAlign.xlHAlignCenter
              .Borders.Weight = XlBorderWeight.xlThin
              .Value = "Since Inspection"
              .Font.Bold = True
              .ColumnWidth = 20
  
          End With
          oSheet.Range("G36:H36").Merge()
          count += 1
          With oSheet.Range("E" &amp; count)
              .Merge()
              .HorizontalAlignment = XlHAlign.xlHAlignCenter
              .VerticalAlignment = XlHAlign.xlHAlignCenter
              .Borders.Weight = XlBorderWeight.xlThin
              .Value = "No. of Loans"
              .Font.Bold = True
              .ColumnWidth = 20
              .WrapText = True
          End With
          With oSheet.Range("F" &amp; count)
              .Merge()
              .HorizontalAlignment = XlHAlign.xlHAlignCenter
              .VerticalAlignment = XlHAlign.xlHAlignCenter
              .Borders.Weight = XlBorderWeight.xlThin
              .Value = "Amount"
              .Font.Bold = True
              .ColumnWidth = 20
              .WrapText = True
          End With
          With oSheet.Range("G" &amp; count)
              .Merge()
              .HorizontalAlignment = XlHAlign.xlHAlignCenter
              .VerticalAlignment = XlHAlign.xlHAlignCenter
              .Borders.Weight = XlBorderWeight.xlThin
              .Value = "No. of Loans"
              .Font.Bold = True
              .ColumnWidth = 20
              .WrapText = True
          End With
          With oSheet.Range("H" &amp; count)
              .Merge()
              .HorizontalAlignment = XlHAlign.xlHAlignCenter
              .VerticalAlignment = XlHAlign.xlHAlignCenter
              .Borders.Weight = XlBorderWeight.xlThin
              .Value = "Amount"
              .Font.Bold = True
              .ColumnWidth = 20
              .WrapText = True
          End With
          count += 1
          oExcel.Visible = True
  </code></pre>