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: 85
Default setting print range

I know how to set a print range w/ the columns set and the rows varying, but
what about the other way around where I don't know the number of columns
every time?

this works for varying rows:
varyingrows = 8
Sheets("testpage").PageSetup.PrintArea = "a1:j" & varyingrows

I tried this for varying columns with no luck:
varyingcolumns=10 'will change w/ every run
Sheets("testpage").PageSetup.PrintArea =
range(cells(1,1),cells(8,varyingcolumns)

any thoughts? thanks, mike allen


 
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 print range with macro Deeds Excel Programming 4 October 4th 05 04:22 PM
Setting print range using VBA Dave Ramage[_2_] Excel Programming 0 July 29th 03 04:35 PM
Setting print range using VBA VBANut Excel Programming 0 July 29th 03 04:20 PM
Setting print range using VBA Ron de Bruin Excel Programming 0 July 29th 03 03:59 PM
Setting Print range Tom Ogilvy Excel Programming 3 July 25th 03 04:06 AM


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