Reputation: 607
I have an excel column which is formatted as a number with one decimal place. I want to filter only the numberd which end in 0. 1.0 2.0 40.0
When i filter manually using Number ends with 0 - it filters out everything. When i use the following code i get the same (although im using multi criteria). Excel 2016.
Sub ImmediateMain()
With ActiveSheet
.AutoFilterMode = False
With ActiveSheet.Range("$A$1:$T$200")
.AutoFilter
.AutoFilter Field:=1, Criteria1:="Immediate"
.AutoFilter Field:=5, Criteria1:="*0"
End With
End With
End Sub
Upvotes: 1
Views: 2466
Reputation: 3777
Apply Conditional Formatting to your data:
Type: Formula based, Formula: =IF(A2=INT(A2))
Formatting: e.g. Yellow Interior Color
And Filter based on Interior Color.
Upvotes: 0
Reputation: 549
click on the dropdown, under number filter, in the search box type "*.0"
then press enter. That is 1 solution
Upvotes: 0
Reputation: 201
You could add another column (column B), with a formula referencing your existing column (column A):
=A1-floor(A1)
You would then filter the column B where the value is 0.
Upvotes: 1
Reputation: 1880
Consider this as an option to the issue.
Add a column to your data and add the below formula for all rows, you could then filter on the result of the formula: -
=IF(ISERR(FIND(".",A1,1)),"Whole","Not whole")
When you store 1.0
in a cell, only 1
is stored, they mean the same thing, but Excel will format it to look like 1.0
if requested (i.e. Show to N decimal places).
The above used find
to see if there is a decimal point, if there is not an error is thrown so iserr
is used, if there is an error, there was no decimal point.
NOTE: You may want to subsequently copy the new column and paste over itself as 'paste special' > 'values' to make filtering easier.
Upvotes: 0