View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.misc
James C[_2_] James C[_2_] is offline
external usenet poster
 
Posts: 17
Default Filter out rows of information in a list via VBA

Thank you for your response.

I am have copied and pasted your suggestion into my current macro and am
having no luck with it working. It comes up with an error message End If
Without Block If.

Tried your macro in a new workbook and it appeasr to hide or delete U codes
leaving the codes that I do not require.

Can you help further?

thanks

--
James


"Gord Dibben" wrote:

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


.