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

Once again I am frustrated by the almost useless Excel VBA programming help.
Why does such a large commercial program have such crappy help? I had better
programming help back in the days of programming on the Atari ST!

I need a way to set the print area where I know the starting and ending
columns and rows. The only example the help gives is for the 'CurrentRegion.'
There is no current region set, nor do I want to force the user to make one.

I would prefer being able to use column and row numbers as opposed to the
A1:G20 method. One would think this would be a simple thing, but here I am.

Any help will be appreciated.

-Steve





  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Setting the print area


startcol = 1
startrow = 3
endcol = 9
endrow = 25
With Activesheet
.PageSetup.PrintArea = .Range(.Cells(startRow,StartCol), _
.Cells(EndRow,EndCol)).Address(1,1,xlA1,True)
End With

--
Regards,
Tom Ogilvy

"Patch61" wrote:

Once again I am frustrated by the almost useless Excel VBA programming help.
Why does such a large commercial program have such crappy help? I had better
programming help back in the days of programming on the Atari ST!

I need a way to set the print area where I know the starting and ending
columns and rows. The only example the help gives is for the 'CurrentRegion.'
There is no current region set, nor do I want to force the user to make one.

I would prefer being able to use column and row numbers as opposed to the
A1:G20 method. One would think this would be a simple thing, but here I am.

Any help will be appreciated.

-Steve





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 336
Default Setting the print area

If you use the recorder you can get the essential code needed (far easier
than trying to find it in Help!), e.g.
ActiveSheet.PageSetup.PrintArea = "A1:J10"

However, as you say, R1C1 method can be easier so it needs amendment:
Dim myRange As String
myRange = "R1C1:R10C10"
myRange = Application.ConvertFormula(myRange, xlR1C1, xlA1)
ActiveSheet.PageSetup.PrintArea = myRange

or (combining it all up):
ActiveSheet.PageSetup.PrintArea =
Application.ConvertFormula("R1C1:R10C10", xlR1C1, xlA1)



"Patch61" wrote:

Once again I am frustrated by the almost useless Excel VBA programming help.
Why does such a large commercial program have such crappy help? I had better
programming help back in the days of programming on the Atari ST!

I need a way to set the print area where I know the starting and ending
columns and rows. The only example the help gives is for the 'CurrentRegion.'
There is no current region set, nor do I want to force the user to make one.

I would prefer being able to use column and row numbers as opposed to the
A1:G20 method. One would think this would be a simple thing, but here I am.

Any help will be appreciated.

-Steve





  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Setting the print area

Thanks, guys. This is exactly what I needed.

-Steve

"Tom Ogilvy" wrote:


startcol = 1
startrow = 3
endcol = 9
endrow = 25
With Activesheet
.PageSetup.PrintArea = .Range(.Cells(startRow,StartCol), _
.Cells(EndRow,EndCol)).Address(1,1,xlA1,True)
End With

--
Regards,
Tom Ogilvy

"Patch61" wrote:

Once again I am frustrated by the almost useless Excel VBA programming help.
Why does such a large commercial program have such crappy help? I had better
programming help back in the days of programming on the Atari ST!

I need a way to set the print area where I know the starting and ending
columns and rows. The only example the help gives is for the 'CurrentRegion.'
There is no current region set, nor do I want to force the user to make one.

I would prefer being able to use column and row numbers as opposed to the
A1:G20 method. One would think this would be a simple thing, but here I am.

Any help will be appreciated.

-Steve







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
Setting The Print Area beans_21 Excel Programming 3 January 10th 06 09:32 AM
setting a print area Matilda Excel Programming 2 November 13th 05 07:45 PM
Setting print area with vba KimberlyC Excel Programming 3 December 18th 04 12:46 AM
SETTING PRINT AREA IN VBA Frankie[_2_] Excel Programming 6 June 24th 04 03:11 PM
Setting print area Don Guillett[_4_] Excel Programming 0 September 4th 03 02:14 PM


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