Thread: Hiding Rows
View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
Stefi Stefi is offline
external usenet poster
 
Posts: 2,646
Default Hiding Rows

Try this macro:
Sub spechide(certsect As Range)
Dim teljesrng As Range, szurtrng As Range, kozos As Range
Range("A1").Select
Selection.AutoFilter
Selection.AutoFilter Field:=2, Criteria1:="="
Selection.AutoFilter Field:=3, Criteria1:="="
Set teljesrng = ActiveSheet.AutoFilter.Range.Columns(1)
Set teljesrng = teljesrng.Offset(1, 0).Resize(teljesrng.Rows.Count - 1)
On Error Resume Next
Set szurtrng = teljesrng.SpecialCells(xlVisible)
Selection.AutoFilter
Set kozos = Intersect(szurtrng, certsect)
kozos.Select
kozos.EntireRow.Hidden = True
On Error GoTo 0
End Sub

Use like this:
Sub test()
Dim certsect As Range
Set certsect = Rows("7:42") 'change next time to "166:196"
Call spechide(certsect)
End Sub


Regards,
Stefi

€žmr_teacher€ť ezt Ă*rta:


Hi Bob,

Thanks for the reply. I am guessing this is a macro code that I need to
put in somewhere? I am still pretty much a beginner with these (pretty
much at the stage where I can record them and have a look at them that
way) so if you could tell me how to put it into my workbook that would
be great.

Bob Phillips Wrote:
Rows(10).Hidden = Cells(10,"B").Value ="" AND Cells(10,"C").Value = ""



Is the 10 in this referring to a number of rows?

Being more specific, I am looking to apply this rule to rows 7 to 42,
and then rows 166 to 196
Thanks a lot for your help

Carl


--
mr_teacher
------------------------------------------------------------------------
mr_teacher's Profile: http://www.excelforum.com/member.php...o&userid=34352
View this thread: http://www.excelforum.com/showthread...hreadid=567408