Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / June 2006

Tip: Looking for answers? Try searching our database.

Print area Macro

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Paul H - 01 Jun 2005 19:15 GMT
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?
David - 01 Jun 2005 19:40 GMT
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,

> 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?
Paul H - 01 Jun 2005 20:04 GMT
David, thanks, it works great.

Paul

> Hi,
> Try this, hope it helps.
[quoted text clipped - 12 lines]
> > 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?
Tom Ogilvy - 01 Jun 2005 19:43 GMT
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

Signature

Regards,
Tom Ogilvy

> 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?
Don Guillett - 01 Jun 2005 19:49 GMT
If that's really what you want to do

Sub printrng()
Range("a1:" & Cells.Find("corner").Address).PrintPreview
End Sub

Signature

Don Guillett
SalesAid Software
donaldb@281.com

> 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?
Latebloomer - 26 Jun 2006 17:33 GMT
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?

> If that's really what you want to do
>
[quoted text clipped - 8 lines]
> then
> > be used as the bottom right point for the print setup. Any ideas?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.