View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
Gord Dibben Gord Dibben is offline
external usenet poster
 
Posts: 22,906
Default Filter out rows of information in a list via VBA

Sub Hide_U_Rows()
Dim RngCol As Range
Dim i As Range
Set RngCol = Range("B1", Range("B" & Rows.Count). _
End(xlUp).Address)
For Each i In RngCol
If Left(i.Value, 1) = "U" Then _
i.EntireRow.Hidden = True
' i.EntireRow.Delete
End If
Next i
End Sub


Gord Dibben MS Excel MVP


On Mon, 25 Jan 2010 06:46:01 -0800, James C
wrote:

I have a list in a worksheet which has a column headings and in one column
contains text data. In the rows the data consists of items such E10, V19 and
U27.The rows in the list change frequenlty, as new data is added, so the
column length varies.

I want to get rid of any item that does not have the prefix U in front of it
and include this in part of an existing VBA statement.

Thanks