Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Macro to show only rows with X
How would I write a script or macro to display rows that have and x in "A"
and hide all other rows? Thank you |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Macro to show only rows with X
With data starting in ColA; try
Cells.AutoFilter Field:=1, Criteria1:="=x" -- Jacob (MVP - Excel) "Jeremy" wrote: How would I write a script or macro to display rows that have and x in "A" and hide all other rows? Thank you |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Macro to show only rows with X
Option Explicit
Sub Remove_Unwanted_Rows() Dim rng As Range Dim cell, RowArray As Range Set rng = ActiveSheet.Range(Cells(1, "A"), Cells(Rows.Count, "A").End(xlUp)) For Each cell In rng Select Case cell Case Is < "x" If RowArray Is Nothing Then Set RowArray = cell.EntireRow Else Set RowArray = Union(RowArray, cell.EntireRow) End If End Select Next cell On Error Resume Next RowArray.EntireRow.Hidden = True Err.Clear End Sub "Jeremy" wrote: How would I write a script or macro to display rows that have and x in "A" and hide all other rows? Thank you |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro code to hide rows and not calculate hidden rows | Excel Discussion (Misc queries) | |||
Macro for deleting rows and serialising the remaing rows | Links and Linking in Excel | |||
Macro to hide/show rows and columns | Excel Discussion (Misc queries) | |||
Hide Rows - copy and paste only rows that show | Excel Worksheet Functions | |||
Pivot Tables: How do I show ALL field rows, including empty rows?? | Excel Worksheet Functions |