Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default Macro to print a cell range

I need to create a Macro to select a print area and then print. This range
will change as more data is added.

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,939
Default Macro to print a cell range

We need a lot more info to create a macro. Perhaps there is an easier way.
The print area for a worksheet is stored as a locally defined named range
called Print_Area. You can change the print area by changing the range
specified in this named range. Here is where it gets interesting. You can
change the print area dynamically by making the named range Dynamic. There is
an excellent explanation of dynamic named ranges on Chip Pearson's website
but the site is down at the moment... google for it later and you should be
able to find how it works...

So if you change Print_Area to something like

=Offset(A1, 0,0, counta(A:A), counta(1:1))
then the print range will adjust as more data is added...
--
HTH...

Jim Thomlinson


"Tamsyn" wrote:

I need to create a Macro to select a print area and then print. This range
will change as more data is added.

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Macro to print a cell range

This will print A1:X(lastusedrow of column A):

Option Explicit
Sub testme()
Dim LastRow As Long
With ActiveSheet
LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
.Range("a1:x" & LastRow).PrintOut preview:=True
End With
End Sub

Tamsyn wrote:

I need to create a Macro to select a print area and then print. This range
will change as more data is added.


--

Dave Peterson
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
print out specified range in macro Wu Excel Discussion (Misc queries) 1 May 25th 08 09:14 AM
Macro print range not dynamic like I wanted it to be TRYING Excel Worksheet Functions 8 November 27th 07 01:05 AM
Macro to print a selected range, not entire worksheet James C Excel Discussion (Misc queries) 3 October 19th 05 10:12 PM
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


All times are GMT +1. The time now is 04:43 PM.

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

About Us

"It's about Microsoft Excel"