View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
K Dales[_2_] K Dales[_2_] is offline
external usenet poster
 
Posts: 1,163
Default Set Print Area programatically

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