Thread: Borders
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Robert McCurdy Robert McCurdy is offline
external usenet poster
 
Posts: 102
Default Borders

The problem with this (no time to work it out now), is how you'd want the previous border dealt with. Maybe assign the range to a range name?

Sub BorderLastRow()
'get rid of the previous border?
ActiveSheet.UsedRange.BorderAround LineStyle = xlLineStyleNone
Dim Rw As Long, bRng As Range
Rw = Cells(Rows.Count, 1).End(xlUp).Row
Set bRng = Range("A1:S" & Rw)
bRng.BorderAround Weight:=xlMedium
End Sub


Regards
Robert McCurdy
"Scott J" wrote in message ...
Hi everyone,

I was wondering if anyone can help me with some code to dynamically place a
border on the last row of a spreadsheet. The issue for me is that the
spreadsheet varies in length (based on filtering), but the columns are static
(A:S). What I was hoping to do is place a border on the last row so the
spreadsheet will be completly framed out once printed.

Does anyone have any ideas?

Thanks,

SJ