Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Norman Jones wrote
Hi David, Perhaps something like this would work for you: Sub Tester() Dim Rng As Range, Rng2 As Range Dim rCell As Range Dim sh As Worksheet Set sh = Sheets("Sheet1") ' <<===== Change If Not sh.AutoFilterMode Then Range("A1").AutoFilter ' <<===== Change? End If Set Rng2 = sh.AutoFilter.Range.Columns(1) For Each rCell In Rng2.Cells If rCell.EntireRow.Hidden Then If Not Rng Is Nothing Then Set Rng = Union(Rng, rCell) Else Set Rng = rCell End If End If Next Application.ScreenUpdating = False 'your filter code here Rng.EntireRow.Hidden = True Application.ScreenUpdating = True End Sub --- Regards, Norman Thanks Norman I may decide to adopt that method on a future project, but for now I've opted out of using AutoFilter altogether. Instead: Sub FaxIt() Dim CurPrinter As String Range("Names").SpecialCells(xlCellTypeBlanks).Enti reRow.Hidden = True CurPrinter = Application.ActivePrinter ActiveWorkbook.PrintOut , ActivePrinter:="Brother PC-FAX on BMFC:" Application.ActivePrinter = CurPrinter Range("Names").EntireRow.Hidden = False End Sub This works as desired and has the added bonus that makes it unnecessary for me to remember to unhide the rows I hid manually before faxing. -- David |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Some comments stay hidden even after picking show/hide all why? | Excel Discussion (Misc queries) | |||
2007 Worksheet, Hidden Columns, .CSV Format Saves Hidden Column Da | Excel Discussion (Misc queries) | |||
Hidden rows columns won't stay hidden | Excel Worksheet Functions | |||
I need my Hidden Rows to stay hidden when I print the sheet. | Excel Discussion (Misc queries) | |||
Ex 2K Standard Toolbar won't stay hidden | Excel Discussion (Misc queries) |