Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

data filter

ResolvedVersion 2007

Izabela has attended:
Excel VBA Intro Intermediate course

Data Filter

Anthony
Thanks for being such a wonderful teacher.

I've got a macro which put a filter in columns but it doesn't filter anything.
I would like the filter to pick all numbers apart 0.
Could you please point me how to do that?
Thanks

RE: Data Filter

Hi Izabela, thanks for your query and the nice words! As for the filter, try this out. I'm going to assume that your macro turns the Autofilter on:

Selection.AutoFilter

I'm then going to filter on Column C (Field 3) and set the criteria so that only records with numbers that are not equal to 0 in that column are pulled out:

ActiveSheet.Range("$A$1:$F$278").AutoFilter Field:=3, Criteria1:="<>0", _
Operator:=xlAnd

That should do the trick! Try apply this to your own data and let me know how you get on.

All the best,

Anthony

 

Training courses

Training information:

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.

Excel tip:

Ctrl+d's double life

Suppose I have a formula in B1 that I wish to copy into B2:B10. I can select B1:B10 then press Ctrl+d to copy the formula down the selected range. Users generally ignore this shortcut in favour of double-clicking on the fill handle to copy down, but Ctrl+d is useful sometimes particularly when there is no data in surrounding columns to guide to how far the double-click method should copy formulae.

Ctrl+d has another use though. When I use the drawing toolbar to draw objects such as Text Boxes, Rectangles and Ovals onto a worksheet, Ctrl+d makes an instant duplicate of selected shapes. For example, I need five Text Boxes the same size. I draw one Text box and adjust it to the size I want, select it, then press Ctrl+d four times to get four identical copies.

View all Excel hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.09 secs.