Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Mervyn
Use this ActiveSheet.PageSetup.PrintArea = Range(Cells(1, 1), Cells(NoOfRows, 29)).Address -- Regards Ron de Bruin http://www.rondebruin.nl "Mervyn Thomas" wrote in message ... 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 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks - that works!
"Ron de Bruin" wrote in message ... Hi Mervyn Use this ActiveSheet.PageSetup.PrintArea = Range(Cells(1, 1), Cells(NoOfRows, 29)).Address -- Regards Ron de Bruin http://www.rondebruin.nl "Mervyn Thomas" wrote in message ... 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 |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
It miss
..Address after selection -- Regards Ron de Bruin http://www.rondebruin.nl "Mervyn Thomas" wrote in message ... 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 |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
PrintArea requires a string argument. It resists range objects unless they
contain a string address maybe selection.Address -- Regards, Tom Ogilvy "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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
set area in excel not giving me option to set print area? | Excel Discussion (Misc queries) | |||
File, print area, clear area, is not working | New Users to Excel | |||
print area across the freeze panes area | Excel Worksheet Functions | |||
Pivot Table macro to set print area and print details of drill down data | Excel Discussion (Misc queries) | |||
How do you turn off a print area for a page? (no print area) | Excel Discussion (Misc queries) |