Border Problem

G

Gizmo

Excel2003

How can I find the last used row, then select cells "A:F" & Lastrow +2 and
apply bottom border.

I tried this code but no go.

Sheets("Debrief Report").Activate
LWriteRow = Cells(65536, 2).End(xlUp).Row
LBorderRow = LWriteRow + 2

Range("A:F" & LBorderRow).Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
Selection.Borders(xlEdgeLeft).LineStyle = xlNone
Selection.Borders(xlEdgeTop).LineStyle = xlNone
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
Selection.Borders(xlEdgeRight).LineStyle = xlNone
Selection.Borders(xlInsideVertical).LineStyle = xlNone
 
J

Jim Cone

Sheets("Debrief Report").Activate
LwriteRow = Cells(Rows.Count, 2).End(xlUp).Row
LborderRow = LwriteRow + 2

With Range("A1", "F" & LborderRow)
.Borders(xlDiagonalDown).LineStyle = xlNone
.Borders(xlDiagonalUp).LineStyle = xlNone
.Borders(xlEdgeLeft).LineStyle = xlNone
.Borders(xlEdgeTop).LineStyle = xlNone
With .Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
.Borders(xlEdgeRight).LineStyle = xlNone
.Borders(xlInsideVertical).LineStyle = xlNone
End With
--
Jim Cone
Portland, Oregon USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)




"Gizmo" <[email protected]>
wrote in message
Excel2003
How can I find the last used row, then select cells "A:F" & Lastrow +2 and
apply bottom border.
I tried this code but no go.

Sheets("Debrief Report").Activate
LWriteRow = Cells(65536, 2).End(xlUp).Row
LBorderRow = LWriteRow + 2

Range("A:F" & LBorderRow).Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
Selection.Borders(xlEdgeLeft).LineStyle = xlNone
Selection.Borders(xlEdgeTop).LineStyle = xlNone
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
End With
Selection.Borders(xlEdgeRight).LineStyle = xlNone
Selection.Borders(xlInsideVertical).LineStyle = xlNone
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top