Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default macro to print a sheet if a cell is a certain value

I have set up the following macro to print certain sheets and it works ok,
however I only want it to print sheet named 'Handback' if cell A1 in that
sheet is greater than 1. How can I incorporate that in the macro?

Thanks in advance of any help.

Regards

John


Sub newprint()
'
' newprint Macro
' Macro recorded 08/02/2006 by
'

'
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Sheets("Customer Profile").Select
Range("b15") = "NEW VEHICLE ENQUIRY"
Sheets("DAN").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Sheets("Customer Profile").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Sheets("Checklist").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Sheets("Handback").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Sheets("New").Select
Range("M46") = "CUSTOMER COPY"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Range("M46").Select
Selection.ClearContents
Sheets("DAN").Select
Range("Z70") = "CUSTOMER COPY"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Range("Z70").Select
Selection.ClearContents
Sheets("Disclosure").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Sheets("AA Cars").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Sheets("New").Select
Range("G10").Select
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default macro to print a sheet if a cell is a certain value

Sheets("Handback").Select
if Range("A1") 1 then
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
End if

--
Regards,
Tom Ogilvy


"John Davies" wrote:

I have set up the following macro to print certain sheets and it works ok,
however I only want it to print sheet named 'Handback' if cell A1 in that
sheet is greater than 1. How can I incorporate that in the macro?

Thanks in advance of any help.

Regards

John


Sub newprint()
'
' newprint Macro
' Macro recorded 08/02/2006 by
'

'
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Sheets("Customer Profile").Select
Range("b15") = "NEW VEHICLE ENQUIRY"
Sheets("DAN").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Sheets("Customer Profile").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Sheets("Checklist").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Sheets("Handback").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Sheets("New").Select
Range("M46") = "CUSTOMER COPY"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Range("M46").Select
Selection.ClearContents
Sheets("DAN").Select
Range("Z70") = "CUSTOMER COPY"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Range("Z70").Select
Selection.ClearContents
Sheets("Disclosure").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Sheets("AA Cars").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Sheets("New").Select
Range("G10").Select

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
Print mutiple sheet macro Razzcul Excel Worksheet Functions 1 August 11th 06 06:52 PM
Print mutiple sheet macro Little Penny Excel Discussion (Misc queries) 0 August 11th 06 03:48 AM
Active cell counting in particular print page (one sheet having different print area) ananthmca2004 Excel Worksheet Functions 1 November 24th 05 11:29 AM
Need Macro to print a sheet conatining drop down menu Faizal Excel Programming 1 April 29th 05 04:06 PM
Macro to print a hidden sheet Glenn Excel Programming 9 April 18th 05 11:32 PM


All times are GMT +1. The time now is 10:01 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"