Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
LastCell
I want to loop through rows first to make sure they are all unhidden, then I
want to hide rows that have "yes" in a cell. This doesn't work because the xlCellTypeLastCell goes to the last visible cell. So if the last cell had "yes" in it, it would have been hidden and my code won't unhide it. I dont' know how to fix it. Hope I explained this. Thanks, Private Sub CAT() Dim i As Long For i = 1 To ActiveSheet.UsedRange.SpecialCells(xlCellTypeLastC ell).Row If Cells(i, 2).Rows(i).Hidden = True Then Cells(i, 2).Rows(i).Hidden = False ElseIf Cells(i, 2).Value = "Yes" Then Rows(i).EntireRow.Hidden = True End If Next i End Sub -- Howard |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel 2007 BUG UsedRange/LastCell differences with Excel2003. | Excel Discussion (Misc queries) | |||
lastcell in thiscolumn function error | Excel Programming | |||
Dynamic LastCell | Excel Programming | |||
LastCell Function | Excel Programming |