Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 44
Default Print Range Macro

I need a macro that will automatically find the row with
the last entry and set the print range to that row and
then print. Assuming columns A through D will contain
data, what would the VBA code look like? Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Print Range Macro

if you remove the Print_Area definition in the Names, then printing the
sheet should do what you want.

otherwise

Dim rng as Range
set rng = Cells(rows.count,1).end(xlup)
Activesheet.PageSetup.Printarea = _
range("A1",rng.offset(0,3)).Address(external:=True )

--
Regards,
Tom Ogilvy


"Jeff" wrote in message
...
I need a macro that will automatically find the row with
the last entry and set the print range to that row and
then print. Assuming columns A through D will contain
data, what would the VBA code look like? Thanks.



Reply
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
Macro to print a cell range Tamsyn Excel Discussion (Misc queries) 2 November 24th 08 04:48 PM
print out specified range in macro Wu Excel Discussion (Misc queries) 1 May 25th 08 09:14 AM
Macro to set print range Brisbane Rob New Users to Excel 2 September 4th 05 03:50 AM
Print range macro nc Excel Discussion (Misc queries) 3 March 21st 05 04:38 PM
Macro print range Shawn[_4_] Excel Programming 1 January 18th 04 03:35 AM


All times are GMT +1. The time now is 02:09 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"