Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I want to print a sheet with the upper left point being A1 with the bottom
right point variable. I could put a word in the cell (i.e. corner), I need a macro to look through the sheet and find the word "corner" this would then be used as the bottom right point for the print setup. Any ideas? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
Try this, hope it helps. Sub Corner1() Cells.Find(What:="corner", After:=ActiveCell, LookIn:=xlFormulas, LookAt _ :=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _ False, SearchFormat:=False).Activate Corner = ActiveCell.Address ActiveSheet.PageSetup.PrintArea = "$A$1:" & Corner End Sub Thanks, "Paul H" wrote: I want to print a sheet with the upper left point being A1 with the bottom right point variable. I could put a word in the cell (i.e. corner), I need a macro to look through the sheet and find the word "corner" this would then be used as the bottom right point for the print setup. Any ideas? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
David, thanks, it works great.
Paul "David" wrote: Hi, Try this, hope it helps. Sub Corner1() Cells.Find(What:="corner", After:=ActiveCell, LookIn:=xlFormulas, LookAt _ :=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _ False, SearchFormat:=False).Activate Corner = ActiveCell.Address ActiveSheet.PageSetup.PrintArea = "$A$1:" & Corner End Sub Thanks, "Paul H" wrote: I want to print a sheet with the upper left point being A1 with the bottom right point variable. I could put a word in the cell (i.e. corner), I need a macro to look through the sheet and find the word "corner" this would then be used as the bottom right point for the print setup. Any ideas? |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
With Activesheet
set rng = .Cells.Find("corner") if not rng is nothing then .PageSetup.PrintArea = _ .Range(.Range("A1"),rng).Address(external:=True) End if End With -- Regards, Tom Ogilvy "Paul H" wrote in message ... I want to print a sheet with the upper left point being A1 with the bottom right point variable. I could put a word in the cell (i.e. corner), I need a macro to look through the sheet and find the word "corner" this would then be used as the bottom right point for the print setup. Any ideas? |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If that's really what you want to do
Sub printrng() Range("a1:" & Cells.Find("corner").Address).PrintPreview End Sub -- Don Guillett SalesAid Software "Paul H" wrote in message ... I want to print a sheet with the upper left point being A1 with the bottom right point variable. I could put a word in the cell (i.e. corner), I need a macro to look through the sheet and find the word "corner" this would then be used as the bottom right point for the print setup. Any ideas? |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
This macro is exactly what I need also, except it's not working-- because I have an "ifand" formula in cells to return the value "corner". The macro is setting the end of the print range at the first cell it sees the formula, not the returned value "corner" How do I tweak this? "Don Guillett" wrote: If that's really what you want to do Sub printrng() Range("a1:" & Cells.Find("corner").Address).PrintPreview End Sub -- Don Guillett SalesAid Software "Paul H" wrote in message ... I want to print a sheet with the upper left point being A1 with the bottom right point variable. I could put a word in the cell (i.e. corner), I need a macro to look through the sheet and find the word "corner" this would then be used as the bottom right point for the print setup. Any ideas? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Pivot Table macro to set print area and print details of drill down data | Excel Discussion (Misc queries) | |||
Create a print macro that would automatically select print area? | Excel Worksheet Functions | |||
Set Print Area with a macro | Excel Programming | |||
Set Print Area Macro | Excel Programming | |||
Macro to select the print area | Excel Programming |