Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 108
Default problem formatting lines around cells

I have reduced the problem to the following test case.
I have a workbook with one sheet. In cell(4, 1) I have manually formatted
the cell to have a lower edge line and right edge line (this is a header row
in the real workbook). When I manually delete row 5 the formatting in
cell(4, 1) remains unchanged. However, if I execute the following subroutine
which puts a right edge in cell(5, 1) and then manually delete row 5 the
lower edge line in cell(4, 1) is removed. In the real workbook I am adding
multiple rows below row 4 with code. What am I missing? I would not like to
have to code row 5 different from the rows below in order to get the lines
properly placed
Option Explicit
Public Sub formatter()
Dim sh As Object
Dim r as long
Set sh = ActiveWorkbook.Sheets("Sheet1")
r = 5
With sh
With Cells(r, 1)
With .Borders(xlEdgeRight)
.LineStyle = xlContinuous
.ColorIndex = xlAutomatic
.TintAndShade = 0
.Weight = xlThin
End With
End With
End With
End Sub

--
russ
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
Problem using formula after formatting cells Stacey Excel Discussion (Misc queries) 2 April 17th 09 02:18 AM
Grid problem with formatting cells... [email protected] New Users to Excel 4 March 5th 08 06:20 PM
Formatting cells, Need help solving a problem with excel Jonnie Z Excel Discussion (Misc queries) 1 February 4th 06 09:59 PM
Formatting merged cells to have lines. lsu-i-like Excel Discussion (Misc queries) 1 November 17th 05 03:29 PM
Some formatting 'lines' will not go away Michael Miller Excel Programming 2 January 11th 05 02:47 PM


All times are GMT +1. The time now is 09:36 AM.

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"