Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Worksheet printing | New Users to Excel | |||
printing a worksheet | Excel Discussion (Misc queries) | |||
printing worksheet | Excel Discussion (Misc queries) | |||
Printing worksheet | New Users to Excel | |||
Printing worksheet | Excel Programming |