Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Find Certain Cell Value and Print that Page Number | Excel Programming | |||
Print area giving me 1 page per cell | Excel Discussion (Misc queries) | |||
Setting the print area in page set up to print 1 page wide by 2 pages tall | Excel Discussion (Misc queries) | |||
Print one cell to one page | Excel Programming | |||
Active cell counting in particular print page (one sheet having different print area) | Excel Worksheet Functions |