Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Print area Macro

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,560
Default Print area Macro

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Print area Macro

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Print area Macro

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default Print area Macro

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Print area Macro

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
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
Pivot Table macro to set print area and print details of drill down data Steve Haskins Excel Discussion (Misc queries) 2 December 28th 05 04:59 PM
Create a print macro that would automatically select print area? wastedwings Excel Worksheet Functions 7 August 22nd 05 10:36 PM
Set Print Area with a macro June Excel Programming 4 July 19th 04 07:40 PM
Set Print Area Macro Grace[_4_] Excel Programming 9 June 12th 04 03:41 PM
Macro to select the print area Gavin[_3_] Excel Programming 5 July 29th 03 02:58 PM


All times are GMT +1. The time now is 03:00 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"