Thank you for being a valued part of the CNET community. As of December 1, 2020, the forums are in read-only format. In early 2021, CNET Forums will no longer be available. We are grateful for the participation and advice you have provided to one another over the years.

Thanks,

CNET Support

General discussion

excel filter in xp

Nov 20, 2004 12:07AM PST

hello,
I need to filter my results in a excel worksheet. I have a row of values representing profit in

Discussion is locked

- Collapse -
Re: excel filter in xp
Nov 22, 2004 6:36AM PST

Hello username,
if you know a little bit of macro writing in Excel then copy this code and place it in a procedure:

Option Base 1
Sub ShowGreaterHideLesser()
Application.ScreenUpdating = False
Dim tmp As Long
tmp = 0
a = Array("A", "B", "C", "D", "E", "F", "G")
For ctr = 1 To 7
Range(a(ctr) & 10).Select
If ActiveCell.Value > 3 Then
tmp = ActiveCell.Value
ActiveCell.Offset(2, 0).Select
ActiveCell.Value = tmp
tmp = 0
End If
Next
Application.ScreenUpdating = True
End Sub

The Option Base 1 declaration should be put in the declarations area. Make a button and assign it the name ShowGreaterHideLesser along with the code. The Array contains the columns A to G for example, and it starts at row 10 also as an example. You could change these ones later to suit your needs.
If you have questions don't be ashamed to ask. I might not be able to answer immediately if I'm at work. Hope this helps a bit.

Swisse

- Collapse -
Re: excel filter in xp
Nov 22, 2004 7:17AM PST

How about an if-function? No need for a macro, in my opinion.

=if(cell<3.00,"",cell)

To make it more general, put the 3.00 in another cell, say b7 and make the formula

=if(cell<$b$7,"",cell)

Hope this helps.


Kees