LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Format page border on print

I have question similar to the one (with answer) below, but I'm not astute
enough of VB to follow it.

In short, I'd like to place a border around a worksheet range when the
worksheet is printed, but make the border invisible to users when inputing
data (purely asthetics). The range will never change from A1:H33. Can you
advise me on how to insert the border only when the print command is
selected? And after someone prints, my hope would be for the border to still
be invisible on their monitor.

Thanks





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


Was this post helpful


 
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
border on last cell of page effects border on beginning cell of ne GaryE Excel Discussion (Misc queries) 0 March 23rd 09 05:47 AM
Bottom Border at Page Break Won't Print Ryan Excel Discussion (Misc queries) 4 January 29th 09 04:11 PM
Printing the border format of a repeated row at top of page Cheryl9246 Excel Discussion (Misc queries) 0 March 28th 08 09:54 PM
Format to print in columns on 1 page craftygramma Excel Discussion (Misc queries) 1 January 15th 06 12:42 AM
How do you format a sheet to fill the entire page to print? Lindsay Excel Discussion (Misc queries) 1 June 28th 05 09:17 PM


All times are GMT +1. The time now is 08:38 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"