Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
MAS MAS is offline
external usenet poster
 
Posts: 19
Default ActiveSheet.PageSetup.PrintArea variable ?

Hi,

I have a macro that prints the content od a range of cells and i have it set
to print D,142 to AA,142 using ActiveSheet.PageSetup.PrintArea =
"$D$142:$AA$142"

Every now and then the row changes (people adding/deleting rows) so I have
created a row variable by searching for a string that only appears in the
row I want to print as follows;

CtoPrintRow = "CTO Requests"
r = 1
Do Until CtoPrintRow = (Cells(r, 1))
r = r + 1
Loop

I can't get my head around how I use now use the variable to print that row,
I have fiddled with it as follows but clearly I am missing something, but
what ?

ActiveSheet.PageSetup.PrintArea = "$D$r:$AA$r"



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default ActiveSheet.PageSetup.PrintArea variable ?

ActiveSheet.PageSetup.PrintArea = "$D$" & r & ":$AA$" & r

--
Regards,
Tom Ogilvy


"MAS" wrote in message
...
Hi,

I have a macro that prints the content od a range of cells and i have it

set
to print D,142 to AA,142 using ActiveSheet.PageSetup.PrintArea =
"$D$142:$AA$142"

Every now and then the row changes (people adding/deleting rows) so I have
created a row variable by searching for a string that only appears in the
row I want to print as follows;

CtoPrintRow = "CTO Requests"
r = 1
Do Until CtoPrintRow = (Cells(r, 1))
r = r + 1
Loop

I can't get my head around how I use now use the variable to print that

row,
I have fiddled with it as follows but clearly I am missing something, but
what ?

ActiveSheet.PageSetup.PrintArea = "$D$r:$AA$r"





  #3   Report Post  
Posted to microsoft.public.excel.programming
MAS MAS is offline
external usenet poster
 
Posts: 19
Default ActiveSheet.PageSetup.PrintArea variable ?

Thank Tom,



"Tom Ogilvy" wrote in message
...
ActiveSheet.PageSetup.PrintArea = "$D$" & r & ":$AA$" & r

--
Regards,
Tom Ogilvy


"MAS" wrote in message
...
Hi,

I have a macro that prints the content od a range of cells and i have it

set
to print D,142 to AA,142 using ActiveSheet.PageSetup.PrintArea =
"$D$142:$AA$142"

Every now and then the row changes (people adding/deleting rows) so I
have
created a row variable by searching for a string that only appears in the
row I want to print as follows;

CtoPrintRow = "CTO Requests"
r = 1
Do Until CtoPrintRow = (Cells(r, 1))
r = r + 1
Loop

I can't get my head around how I use now use the variable to print that

row,
I have fiddled with it as follows but clearly I am missing something, but
what ?

ActiveSheet.PageSetup.PrintArea = "$D$r:$AA$r"







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
Help - Error: Unable to set the PrintArea property of the PageSetup class Marie J-son[_5_] Excel Programming 3 January 5th 05 02:04 PM
PrintArea rickey24[_17_] Excel Programming 1 October 6th 04 08:04 PM
PRINTAREA Giacomo[_3_] Excel Programming 4 October 28th 03 10:43 PM
How to copy text from a TextBox in a ActiveSheet to a variable Tom Ogilvy Excel Programming 2 August 19th 03 06:35 PM
How to copy text from a TextBox in a ActiveSheet to a variable pat Excel Programming 0 August 19th 03 05:06 PM


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