Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Worksheet printing

Does anyone have any routines available which will allow one to print off
worksheets in a spreadsheet which have entries in them, e.g. worksheets 1,
4, and 5 will have data in whereas 2 and 3 are empty?

Thanks in advance

Colin


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,090
Default Worksheet printing

Colin
The code would have to have a means of determining that a sheet is empty
or not empty. This can be done by various means, some easier than others.
Is there some clue (this cell has an entry or that range has some entries,
etc.) that the code can use to make this determination? The code can even
be written to make this determination without any clues at all, if
necessary.
Basically, the code would be a For loop through all the sheets in the
workbook, then determine which ones to print by the clues you furnish, print
it (or not) and then go to the next sheet. Post back with a bit more detail
about what you have. HTH Otto
"Colin Telfer" wrote in message
...
Does anyone have any routines available which will allow one to print off
worksheets in a spreadsheet which have entries in them, e.g. worksheets 1,
4, and 5 will have data in whereas 2 and 3 are empty?

Thanks in advance

Colin




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,510
Default Worksheet printing

Hi Colin,

The following code should perform the test you want.

Sub Test_Used_Area()

Dim rng1 As Range
Dim ws As Worksheet

For Each ws In Sheets
ws.Select
Set rng1 = ws.UsedRange

If rng1.Cells.Count = 1 And rng1.Cells(1, 1) = Empty Then
MsgBox ws.Name & " is empty"
Else
MsgBox ws.Name & " is not empty"
End If

Next ws
End Sub

Regards,

OssieMac

"Colin Telfer" wrote:

Does anyone have any routines available which will allow one to print off
worksheets in a spreadsheet which have entries in them, e.g. worksheets 1,
4, and 5 will have data in whereas 2 and 3 are empty?

Thanks in advance

Colin



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
Worksheet printing tb New Users to Excel 2 February 25th 10 04:34 PM
printing a worksheet Jim Excel Discussion (Misc queries) 2 January 4th 09 06:57 PM
printing worksheet Ruster2 Excel Discussion (Misc queries) 1 June 22nd 06 09:41 PM
Printing worksheet davejon New Users to Excel 4 November 25th 05 04:19 PM
Printing worksheet courtesio99[_10_] Excel Programming 14 December 22nd 03 04:27 PM


All times are GMT +1. The time now is 03:56 AM.

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"