Filter by line break

S

solomon_monkey

If you have a line break character in an Excel Cell (i.e. you press Alt
& Enter) is there any way you can filter by cells containing this?
Regards,
 
S

Sharad

Yes it's possible.
At the last row + 1, double click on cell and just press Alt+Enter. So
this cell has only the line break nothing else.
Inlcude this row when setting the Data filer.
In filter chose Custom, and give following condition:-

Contains: -> Click on drop down and select the empty row (which will be
at the top and contains the line break)

And

Does not end with:-> Click the drop down and again selectg the same
empty row.

Sharad
 
D

Debra Dalgleish

To do this manually:

From the dropdown list in the column heading, choose Custom
From the first dropdown, choose Contains
In the text box, hold the Alt key, and on the number keypad,
type: 0010
Click OK

To filter programmatically, use Chr(10), e.g.:

Selection.AutoFilter Field:=4, _
Criteria1:="=*" & Chr(10) & "*", Operator:=xlAnd
 
S

solomon_monkey

Thanks Debra... is there a similar simple code for filtering the colour
of a cell?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top