View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Mervyn Thomas Mervyn Thomas is offline
external usenet poster
 
Posts: 44
Default Set Print Area programatically

I thought so too! but the other reply does work
Mervyn
"K Dales" wrote in message
...
Syntax is OK; are you sure NoOfRows gives the correct result? If it is 0,
this would give "Application defined or object defined error."

"Mervyn Thomas" wrote:

Can anyone help me get the syntax right. I have tried variations on the
theme:

Range(Cells(1, 1), Cells(NoOfRows, 29)).Select
ActiveSheet.PageSetup.PrintArea = Selection

but cannot get anything past the debugger!

Thanks
mervyn