Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I insert borders in every cell in a column Steve Excel Discussion (Misc queries) 1 February 18th 10 11:23 PM
retain result RobcPettit[_2_] Excel Programming 1 September 17th 06 01:13 PM
Formula should retain T De Villiers[_29_] Excel Programming 7 July 6th 06 02:21 PM
insert row keeping borders Lise Excel Discussion (Misc queries) 1 May 6th 06 05:36 PM
Modify code to insert borders Phil H[_2_] Excel Programming 2 April 28th 06 02:44 PM


All times are GMT +1. The time now is 10:49 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"