Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default setting a print area


I cannot arrive at the correct syntax to define my selected range as the
print area:
Set prntRng = Range(Cells(1, 1), Cells(i, 12))
prntRng.Select
ActiveSheet.PageSetup.PrintArea =

Help appreciated, many thanks
Matilda

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 59
Default setting a print area

The printarea is specified as a string. You therefore need to provide a
string like

ActiveSheet.PageSetup.PrintArea = "$A$1:$L$" & i

or if you want to use the range address then:

Set prntRng = Range(Cells(1, 1), Cells(i, 12))
ActiveSheet.PageSetup.PrintArea = prntRng.address

HTHs


"Matilda" wrote:


I cannot arrive at the correct syntax to define my selected range as the
print area:
Set prntRng = Range(Cells(1, 1), Cells(i, 12))
prntRng.Select
ActiveSheet.PageSetup.PrintArea =

Help appreciated, many thanks
Matilda

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default setting a print area



"Martin Fishlock" wrote:

The printarea is specified as a string. You therefore need to provide a
string like

ActiveSheet.PageSetup.PrintArea = "$A$1:$L$" & i

or if you want to use the range address then:

Set prntRng = Range(Cells(1, 1), Cells(i, 12))
ActiveSheet.PageSetup.PrintArea = prntRng.address

HTHs


"Matilda" wrote:


I cannot arrive at the correct syntax to define my selected range as the
print area:
Set prntRng = Range(Cells(1, 1), Cells(i, 12))
prntRng.Select
ActiveSheet.PageSetup.PrintArea =

Help appreciated, many thanks
Matilda


Absolutely perfect, thankyou Martin! I can sleep now :-)

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 Area Setting RozBuds Excel Discussion (Misc queries) 3 February 19th 10 09:41 PM
Setting The Print-Area ? Robert11[_3_] New Users to Excel 2 May 31st 09 03:24 PM
Setting print area richzip Excel Discussion (Misc queries) 1 April 27th 08 08:10 AM
Setting print area with vba KimberlyC Excel Programming 3 December 18th 04 12:46 AM
Setting print area Don Guillett[_4_] Excel Programming 0 September 4th 03 02:14 PM


All times are GMT +1. The time now is 09:19 AM.

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"