Thread: Borders
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
JLGWhiz JLGWhiz is offline
external usenet poster
 
Posts: 3,986
Default Borders


What you could do is put the following line of code after your print
activity is completed.

ActiveSheet.Range("A1:S" & lr).Borders.LineStyle = xlLineStyleNone

That will remove the border so you can do other things and then save the file.
If you plan on the column lengths changing and the file being printed during
a single session, then I suggest you put the border commands in separate subs
and use a conditional If ... Then statement to call them as needed. The
border will not automatically move with a change in the size of the database,
but the macro will resize the border each time it is run, based on the size
of the database. Now that I have you thoroughly confused, I'll say good
night.

"Scott J" wrote:

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