Hi!
Ran into a silly issue, but not sure how to get past it. I have value in cell "N10" with 2 decimal places (from SUBTOTAL formula, but manual entry makes no difference). I also use "European" numeric system with comma as the decimal separator (instead of dots).
This decimal separator seems to create major issues when using cell value as input parameter for VBA autofilter. On closer inspection, my cell value "161,06" has been converted into "161.06" in autofilter, ending up with no results. Both search parameter value and table values both obviously share commas as decimal separators.
I have tried formatting both search and table range into General and Number, but to no avail. Also custom formatting doesn't provide the option to change the decimal separator in my single table (although that's not a preferred workaround). Seems relatively easy, however I'm clueless on how to proceed.
Have been testing with a code snippet like this one:
One option would be to add a helper column in my table where to rebuild my number from , to . separator and run the filter on this column, however hoping there's a more humane way to do it.
Ran into a silly issue, but not sure how to get past it. I have value in cell "N10" with 2 decimal places (from SUBTOTAL formula, but manual entry makes no difference). I also use "European" numeric system with comma as the decimal separator (instead of dots).
This decimal separator seems to create major issues when using cell value as input parameter for VBA autofilter. On closer inspection, my cell value "161,06" has been converted into "161.06" in autofilter, ending up with no results. Both search parameter value and table values both obviously share commas as decimal separators.
I have tried formatting both search and table range into General and Number, but to no avail. Also custom formatting doesn't provide the option to change the decimal separator in my single table (although that's not a preferred workaround). Seems relatively easy, however I'm clueless on how to proceed.
Have been testing with a code snippet like this one:
Code:
Sub TEST()
With ActiveSheet.ListObjects("Table1").Range
.AutoFilter Field:=8, Criteria1:=Range("N10")
End With
End Sub
One option would be to add a helper column in my table where to rebuild my number from , to . separator and run the filter on this column, however hoping there's a more humane way to do it.