Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Filter cells with non-whole numbers or comment
How do filter cells so only those not a whole number (like .5, .123, .
85) or a comment returns ? This is in the same column, but if possible would I like it to apply to multiple columns (I think advanced filter is needed). Also if the comment part can not be done, then the number will do. Data 11.5 11 10 7.85 4 (has comment) (Advanced) Filter should return 11.5 7.85 4 |
#2
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Filter cells with non-whole numbers or comment
For the non integers you can use an auxiliary column with the formula:
=MOD(A2,1)<0 You can then filter on TRUE. I don;t know of a way to identify comments in a cell other than VBA. You can define the following function Function HasComment(r as Range) HasComment = IsNull(r.comment) End Function You can then use another auxiliary column with the formula: =HASCOMMENT(A2) And again filter on TRUE/FALSE HTH Kostis Vezerides On Nov 16, 1:24*pm, Kim wrote: How do filter cells so only those not a whole number (like .5, .123, . 85) or a comment returns ? This is in the same column, but if possible would I like it to apply to multiple columns (I think advanced filter is needed). Also if the comment part can not be done, then the number will do. Data 11.5 11 10 7.85 4 (has comment) (Advanced) Filter should return 11.5 7.85 4 |
#3
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Filter cells with non-whole numbers or comment
vezerid way is not possible to use with advanced filter. Any other
ideas ? |
#4
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Filter cells with non-whole numbers or comment
Two things:
First, I checked better and found a way to test for comment. This is the revised and tested HasComment Function HasComment(r As Range) On Error Resume Next Err.Number = 0 temp = r.Comment.Text If Err.Number < 0 Then HasComment = False Else HasComment = True End If End Function Second, I tested advanced filter on a list and it worked too. Are you sure you are using the criteria mechanism correctly? Auxiliary columns should be placed next to the data and should also have headers. Say you give the header Decimal to aux 1 and Comment to aux 2. Then you need the following configuration as criteria range, in say K1:L2: Decimal Comment TRUE TRUE Then you will get only cells with comments and which also have a decimal part. HTH Kostis On Nov 19, 3:39*pm, Kim wrote: vezeridway is not possible to use with advanced filter. Any other ideas ? |
#5
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Filter cells with non-whole numbers or comment
On Nov 19, 6:54*pm, vezerid wrote:
Two things: First, I checked better and found a way to test for comment. This is the revised and tested HasComment Function HasComment(r As Range) * On Error Resume Next * * Err.Number = 0 * * temp = r.Comment.Text * * If Err.Number < 0 Then * * * * HasComment = False * * Else * * * * HasComment = True * * End If End Function Second, I tested advanced filter on a list and it worked too. Are you sure you are using the criteria mechanism correctly? Auxiliary columns should be placed next to the data and should also have headers. Say you give the header Decimal to aux 1 and Comment to aux 2. Then you need the following configuration as criteria range, in say K1:L2: Decimal Comment TRUE *TRUE Then you will get only cells with comments and which also have a decimal part. HTH Kostis On Nov 19, 3:39*pm, Kim wrote: vezeridway is not possible to use with advanced filter. Any other ideas ? I tried both using the same columns with the conditions in the first rows, and also with extra columns with the same names and rows has the formulas. Both like ="=MOD(A2;1)<0" and "=MOD(A2;1)<0". Using aux columns for each I want filter is a lot - I have data from A- AI (29 columns). HasComment has never been accepted as a function in Excel 2007 and I have allowed trust to VBA and all macros. Placing the HasComment in the sheet or global VBA had no difference. Using an aux column with "=MOD(A2;1)<0" and then filter on that is the only thing I got to work. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
EXCEL FILTER OF COMMENT CONTENT | Excel Discussion (Misc queries) | |||
Copy only visible cells after filter is applied/ sum after filter | Excel Worksheet Functions | |||
How do I use advanced filter to filter for blank cells? | Excel Discussion (Misc queries) | |||
Comment indicators show as numbers in HTML | Excel Discussion (Misc queries) | |||
Comment position after filter | Excel Discussion (Misc queries) |