![]() Range3.EndUpdateFormatting(range3Formatting) ' Set all horizontal and vertical borders separately for the range of cells.ĭim range3 As CellRange = worksheet.Range("D21:F23")ĭim range3Formatting As Formatting = range3.BeginUpdateFormatting()ĭim range3Borders As Borders = range3Formatting.Borders (Color.DeepSkyBlue, BorderLineStyle.Medium) Range2.SetInsideBorders(Color.SkyBlue, BorderLineStyle.MediumDashed) ' Set all inside and outside borders separately for the range of cells.ĭim range2 As CellRange = worksheet.Range("C15:F18") ' Set all borders for the range of cells in one step.ĭim range1 As CellRange = worksheet.Range("B8:F13") ' Set all outside borders for the cell in one step.ĭim cellD6 As Cell = worksheet.Cells("D6")Ĭ(Color.Gold, BorderLineStyle.Double) ' Set each particular border for the cell.ĭim cellB2 As Cell = worksheet.Cells("B2")ĭim cellB2Borders As Borders = cellB2.BordersĬ = BorderLineStyle.MediumDashDotĬ = Color.PinkĬ = BorderLineStyle.MediumDashDotDotĬ = Color.HotPinkĬ = BorderLineStyle.MediumDashedĬ = Color.DeepPinkĬ = BorderLineStyle.MediumĬ = Color.RedĬellB2Borders.DiagonalBorderType = DiagonalBorderType.UpĬellB2Borders.DiagonalBorderLineStyle = BorderLineStyle.ThickĬellB2Borders.DiagonalBorderColor = Color.Redĭim cellC4 As Cell = worksheet.Cells("C4")ĭim cellC4Borders As Borders = cellC4.BordersĬellC4Borders.SetDiagonalBorders(Color.Orange, BorderLineStyle.Double, DiagonalBorderType.UpAndDown) Range4.EndUpdateFormatting(range4Formatting) ĭim worksheet As Worksheet = workbook.Worksheets(0) Range4Borders.DiagonalBorderColor = Color.BlueViolet Range4Borders.DiagonalBorderLineStyle = BorderLineStyle.MediumDashed Range4Borders.DiagonalBorderType = DiagonalBorderType.UpAndDown Range4Borders.SetOutsideBorders(Color.Black, BorderLineStyle.Thick) Set each particular border for the range of cell.ĬellRange range4 = worksheet.Range įormatting range4Formatting = range4.BeginUpdateFormatting() īorders range4Borders = range4Formatting.Borders Set all horizontal and vertical borders separately for the range of cells.ĬellRange range3 = worksheet.Range įormatting range3Formatting = range3.BeginUpdateFormatting() īorders range3Borders = range3Formatting.Borders ![]() ![]() Set all inside and outside borders separately for the range of cells.ĬellRange range2 = worksheet.Range Set all borders for the range of cells in one step.ĬellRange range1 = worksheet.Range Set all outside borders for the cell in one step.Ĭ(Color.Gold, BorderLineStyle.Double) Set each particular border for the cell.Ĭ = BorderLineStyle.MediumDashDot Ĭ = Color.Pink Ĭ = BorderLineStyle.MediumDashDotDot Ĭ = Color.HotPink Ĭ = BorderLineStyle.MediumDashed Ĭ = Color.DeepPink Ĭ = BorderLineStyle.Medium Ĭ = Color.Red ĬellB2Borders.DiagonalBorderType = DiagonalBorderType.Up ĬellB2Borders.DiagonalBorderLineStyle = BorderLineStyle.Thick ĬellB2Borders.DiagonalBorderColor = Color.Red ĬellC4Borders.SetDiagonalBorders(Color.Orange, BorderLineStyle.Double, DiagonalBorderType.UpAndDown) Worksheet worksheet = workbook.Worksheets This example demonstrates how to specify different borders for individual cells and ranges of cells by modifying the Borders object. To share the same cell border settings between multiple cells in one step, create or modify a style with the Formatting.Borders property specified as required, and assign this style to CellRange.Style for the desired cells. ![]()
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |