Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Insert new row and retain borders
This would be my approach:
If iDisp 10 Then With oSheet.Range("A65536").Range("A" & iDisp + 4) .EntireRow.Insert 'Set the line thickness to your liking .BorderAround Weight:=xlThick, ColorIndex:=xlAutomatic End With End If "hooie" wrote: I have an Excel template that I'm filling from VB.NET and saving as a new spreadsheet. If I add a new row, the formatting carries over but not the cell borders. Is there an option or setting I'm missing? <code ' Because this is in a neatly formatted template with only 10 rows (+4 rows of header), ' delete the last row in the spreadsheet and insert it back where we need it. If iDisp 10 Then oSheet.Range("A65536").Rows.Delete() oSheet.Range("A" & iDisp + 4).EntireRow.Insert(Excel.XlInsertShiftDirection.x lShiftDown, Excel.XlInsertFormatOrigin.xlFormatFromLeftOrAbove ) End If </code |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I insert borders in every cell in a column | Excel Discussion (Misc queries) | |||
retain result | Excel Programming | |||
Formula should retain | Excel Programming | |||
insert row keeping borders | Excel Discussion (Misc queries) | |||
Modify code to insert borders | Excel Programming |