Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
after autofilter/delete rows left not visible
I am using an autofilter to select rows that I want to delete, then
delete them, I then turn off the autofilter and select cell A2 and enable screenupdating. But at the end of executing this code row A2 is not visible, rather a row much lower (608 actually) is visible in the window. How do I get row A2 to be visible in the window? Dim rTable As Range Range("A1").Select With Selection If .Cells.Count 1 Then Set rTable = Selection Else Set rTable = .CurrentRegion On Error GoTo 0 End If End With Range("A2").Select ActiveSheet.AutoFilterMode = False ' Delete all rows that are NOT for year 2005 rTable.AutoFilter Field:=2, Criteria1:="<*"2005"*", Operator:=xlAnd rTable.Offset(1, 0).SpecialCells(xlCellTypeVisible).EntireRow.Delet e Range("A1").Select ActiveSheet.AutoFilterMode = False Range("A2").Select Application.ScreenUpdating = True John Keith |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Print Only Visible Rows Using AutoFilter | Excel Programming | |||
Excel copy only visible rows from autofilter | Excel Discussion (Misc queries) | |||
countif for only visible rows when combined with autofilter - possible? | Excel Discussion (Misc queries) | |||
AutoFilter: Loop Thru Visible Rows? | Excel Programming | |||
AutoFilter - which rows are currently visible? | Excel Programming |