Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Hide Second Row - Relative (row number changes)
Hi All,
Should be easy -- I simply want to hide the second row, but that row number may be two now, three later, and four after that.... How do I get it to not care about the row number, yet hide the second visible row? Thanks! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Hide Second Row - Relative (row number changes)
Sub BBB()
Dim i As Long, j As Long i = 0 j = 1 Do Until i = 2 If Cells(j, 1).EntireRow.Hidden = False Then If i = 1 Then Cells(j, 1).EntireRow.Hidden = True i = i + 1 Exit Do Else i = i + 1 End If End If j = j + 1 Loop End Sub You could also probably use specialcells, but I would need to know more about what is on your sheet and what you are doing. The above should be sufficient. -- Regards, Tom Ogilvy "JEFF" wrote in message ... Hi All, Should be easy -- I simply want to hide the second row, but that row number may be two now, three later, and four after that.... How do I get it to not care about the row number, yet hide the second visible row? Thanks! |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Hide Second Row - Relative (row number changes)
Here's one way
Dim i As Long Dim fVisible As Boolean For i = 1 To Rows.Count If Not Rows(i).Hidden Then If fVisible Then Rows(i).Hidden = True Exit For Else fVisible = True End If End If Next i -- HTH RP (remove nothere from the email address if mailing direct) "JEFF" wrote in message ... Hi All, Should be easy -- I simply want to hide the second row, but that row number may be two now, three later, and four after that.... How do I get it to not care about the row number, yet hide the second visible row? Thanks! |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Hide Second Row - Relative (row number changes)
Perfect...... Thanks gentlemen (I'm sure you have better things to do on a
Sunday, if not, could you briefly tell me what some of these commands mean?!) "Tom Ogilvy" wrote: Sub BBB() Dim i As Long, j As Long i = 0 j = 1 Do Until i = 2 If Cells(j, 1).EntireRow.Hidden = False Then If i = 1 Then Cells(j, 1).EntireRow.Hidden = True i = i + 1 Exit Do Else i = i + 1 End If End If j = j + 1 Loop End Sub You could also probably use specialcells, but I would need to know more about what is on your sheet and what you are doing. The above should be sufficient. -- Regards, Tom Ogilvy "JEFF" wrote in message ... Hi All, Should be easy -- I simply want to hide the second row, but that row number may be two now, three later, and four after that.... How do I get it to not care about the row number, yet hide the second visible row? Thanks! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Date + relative number reference | Excel Worksheet Functions | |||
HLOOKUP - Relative cell reference in row index number | Excel Discussion (Misc queries) | |||
how do i make a sheet number relative in a formula | Excel Worksheet Functions | |||
How do I hide the Check Box number? | Excel Worksheet Functions | |||
Column picked randomly with probability relative to number of entr | Excel Worksheet Functions |