Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Problem using formula after formatting cells | Excel Discussion (Misc queries) | |||
Grid problem with formatting cells... | New Users to Excel | |||
Formatting cells, Need help solving a problem with excel | Excel Discussion (Misc queries) | |||
Formatting merged cells to have lines. | Excel Discussion (Misc queries) | |||
Some formatting 'lines' will not go away | Excel Programming |