Help writing a macro to filter

Texcel

New Member
Joined
Oct 9, 2002
Messages
20
I am trying to write a macro that will filter based on a certain criteria. I know how to record the basic macro, but my criteria is not as simple. I want to display all rows where column C is an error (i.e. #DIV/0!, #N/A). How do I get the filter to recognize column C is a error?
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Welcome!

ISNA() will return a Boolean for NA#

To avoid div/0, use an if() to test for the divisor = 0.

HTH,
Corticus
This message was edited by Corticus on 2002-10-16 16:39
 
Upvote 0
On 2002-10-16 16:04, Texcel wrote:
I am trying to write a macro that will filter based on a certain criteria. I know how to record the basic macro, but my criteria is not as simple. I want to display all rows where column C is an error (i.e. #DIV/0!, #N/A). How do I get the filter to recognize column C is a error?

The ISERROR worksheet function will return TRUE if its referenced value is any error type (#N/A, #VALUE!, #REF!, #DIV/0!, #NUM!, #NAME?, or #NULL!). You may also want to examine the Excel Help topic for "ERROR.TYPE worksheet function" if you want to discriminate between these errors.
 
Upvote 0

Forum statistics

Threads
1,203,545
Messages
6,056,033
Members
444,840
Latest member
RazzelDazel

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top