Excel VBA column-specific autofiltering not processing comma-separated decimals, why and what to do?

MrDash

New Member
Joined
May 13, 2022
Messages
2
Office Version
  1. 365
  2. 2021
  3. 2003 or older
Platform
  1. Windows
A few days ago I faced a need to create a set of data tables that would allow users to quickly filter the data based on at least 10 datapoints (columns). As an old Excel fanboy I switched to the newest desktop app, part of the 365 package. I'm most familiar with the old 2003 desktop version.

I need to create range filters, and was surprised to learn that Excel really does not have these controls out of the box. Seem to be in their BI offering though. So I created for each of these 10 columns three ActiveX controls: min value textbox, max value textbox and reset button that resets both min and max. The min and max textbox is linked to two cells. Then I wrote the VBA macro that autofilters each column based on the values created from the linked cells' text content and hides the autofiltering arrow of the column. Seven of the columns started autofilter like a charm, but three did not. These had decimal (floating point) numbers, not integers. The data was good, as manual autofiltering worked flawlessly for decimal numbers too. So I started to suspect it has something to do with either decimal character conversions that take place under the Excelhood. Googled a bit and found link to an article (TEXT vs VALUE vs VALUE2 – Slow TEXT and how to avoid it), was running out of time, tried out Range.Value2 and Range.Text insted of Range.Value already in the code, and ended up with a working filtering system, but only after setting Excel's decimal separator to dot (.) and not comma (,) which we use here.

Now with slightly easier schedule I'd need to find how to make autofiltering process comma decimal separated data correctly. Can someone please help?

Any and all help is greatly appreciated!

Thanks in advance.
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
I wonder if you were to set the decimal separator in the options menu to a comma rather than decimal.
1652453307329.png
 
Upvote 0
I wonder if you were to set the decimal separator in the options menu to a comma rather than decimal.
View attachment 64607
Thanks for helping out. I chose File - Options - Advanced, unselected Use system separators, and right under the option set Decimal separator as .
I did not do anything to the unselected Automatically insert a decimal point.
 
Upvote 0

Forum statistics

Threads
1,224,819
Messages
6,181,153
Members
453,021
Latest member
Justyna P

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