Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default Print page based on the value of a cell

If cell A1=1 as the result of a change entry, I would like the page to
print. Is there a macro that will accomplish this? Thanks for any
help.

Michael
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,071
Default Print page based on the value of a cell

The following macro will do that. I left the print command line for you to
fill because I have no idea what you want to print. This macro must be
placed in the sheet module of your sheet. You can access that module by
right-clicking on the sheet tab and selecting View Code. "X" out of the
module to return to your sheet. HTH Otto
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count 1 Then Exit Sub
If Not Intersect(Target, Range("A1")) Is Nothing And _
Target = 1 Then
'place print code here
End If
End Sub

"Michael Lanier" wrote in message
...
If cell A1=1 as the result of a change entry, I would like the page to
print. Is there a macro that will accomplish this? Thanks for any
help.

Michael



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default Print page based on the value of a cell

Thanks Otto. Unfortunately, I have no idea how to write the print
code. The range to be printed is A1:N57, assuming the value of A1=1.
Does that help?

Michael
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,071
Default Print page based on the value of a cell

Yes. The print command line would be:
Range("A1:N57").PrintOut
The macro I gave you will fire when a 1 is entered into cell A1. HTH Otto
"Michael Lanier" wrote in message
...
Thanks Otto. Unfortunately, I have no idea how to write the print
code. The range to be printed is A1:N57, assuming the value of A1=1.
Does that help?

Michael



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default Print page based on the value of a cell

Otto,

Thanks for your help. Unfortunately, the macro debugs and the
following is highlighted:

If Target.Count 1 Then

I entered the macro in Sheet1 which is the page to be printed. Do you
have any suggestions? Thanks.

Michael


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,071
Default Print page based on the value of a cell

That line should be:
If Target.Count 1 Then Exit Sub
Do you have the whole line?
If you do have the whole line and it still gets that error, send me your
file. Change/delete the data if you wish. My email is
. Remove the "extra" from this address. HTH
Otto
"Michael Lanier" wrote in message
...
Otto,

Thanks for your help. Unfortunately, the macro debugs and the
following is highlighted:

If Target.Count 1 Then

I entered the macro in Sheet1 which is the page to be printed. Do you
have any suggestions? Thanks.

Michael



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
Find Certain Cell Value and Print that Page Number RyanH Excel Programming 1 November 8th 07 10:20 PM
Print area giving me 1 page per cell Coop Excel Discussion (Misc queries) 4 September 19th 07 05:36 AM
Setting the print area in page set up to print 1 page wide by 2 pages tall EA[_2_] Excel Discussion (Misc queries) 2 July 12th 07 08:39 PM
Print one cell to one page asc4john Excel Programming 1 July 4th 07 10:56 PM
Active cell counting in particular print page (one sheet having different print area) ananthmca2004 Excel Worksheet Functions 1 November 24th 05 11:29 AM


All times are GMT +1. The time now is 09:29 PM.

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

About Us

"It's about Microsoft Excel"