LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 42
Default various printing from a hiden sheet

"Shawn" wrote:
I have a hidden sheet with a table of data. Column B:B has various employee
names in it in desending alphabetical order. I would like a macro that
would, without selecting the page if possible, print out all rows of data
with employee A, then, on another sheet, print out all rows of data with
employee B, then employee C and so on.


Do you want to print this information on another worksheet or on paper?

The AutoFilter method is probably the best way to do this, but you first
have to set up a range on which to run the method.

The other thing you have to do is provide some method of selecting which of
the names in column B you want to use as the filter criterion. Maybe you
could generate a form and populate a listbox with unique entries from the
column in question.

Another problem with your plan is that you can't print from a hidden sheet.
If you really want to print from the hidden sheet, you have to temporarily
unhide it.
Here's something to get you started:

Sub JustSmith()
'Dim, Dim, Dim...
Set sht = Sheets("NameOfHiddenSheet")

topRow = sht.Range("B1").End(xlDown).Row
bottomRow = sht.Range("B65536").End(xlUp).Row
Set NameRange = sht.Range("B" & topRow & ":B" & bottomRow)
' ... or set up range some other way if you have to

' you can replace hard-coded name with text from listbox:
NameRange.AutoFilter Field:=1, Criteria1:="Smith, Tom",
VisibleDropdown:=False

Application.ScreenUpdating = False
sht.Visible = xlSheetVisible
sht.PrintPreview ' or .PrintOut
sht.Visible = xlSheetHidden
Application.ScreenUpdating = True

End Sub

If you want to copy to another sheet, you could step through each row of the
NameRegion, decide if it is not hidden (AutoFilter hides non-matching rows,)
then copy non-hidden rows to another worksheet.

--Shawn
 
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
Printing Hiden Pages Slave2Six Excel Discussion (Misc queries) 0 August 1st 06 11:16 PM
Why can't I unhide a hiden row JBurke Excel Discussion (Misc queries) 7 January 8th 05 03:59 PM
Is column hiden? ianripping[_100_] Excel Programming 0 November 5th 04 04:24 PM
Is column hiden? ianripping[_99_] Excel Programming 2 November 5th 04 12:08 PM
hiden sheet scrabtree[_2_] Excel Programming 3 August 4th 04 02:55 PM


All times are GMT +1. The time now is 02:24 AM.

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"