Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Selective Printing of Excel Worksheets using Macro

I need a VBS script for an Excel Macro to print a worksheet but only if one
of the fields on the sheet has been filled. At the moment my Macro prints
every worksheet that might be needed and I'm wasting a ton of paper and ink
every time.

Any help :)

Dan
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Selective Printing of Excel Worksheets using Macro

Try this:-

Sub selectiveprint()
Dim wSheet As Worksheet
For Each wSheet In Worksheets
wSheet.Select
If Cells(1, 1).Value = "Print Me" Then
wSheet.PrintOut
End If
Next wSheet
End Sub

Mike

"Daniel Clough" wrote:

I need a VBS script for an Excel Macro to print a worksheet but only if one
of the fields on the sheet has been filled. At the moment my Macro prints
every worksheet that might be needed and I'm wasting a ton of paper and ink
every time.

Any help :)

Dan

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
Copying Selective Data Between Worksheets JohnM New Users to Excel 5 June 16th 09 01:39 AM
Selective Macro Security in Excel 2007 DOUG Excel Discussion (Misc queries) 0 April 2nd 09 06:10 PM
Selective printing of worksheet Zygy[_3_] New Users to Excel 3 October 11th 07 12:59 PM
Selective linking items between two worksheets dd Excel Worksheet Functions 9 September 15th 06 11:20 PM
Selective linking items between two worksheets dd Excel Programming 9 September 15th 06 11:20 PM


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