Hi all,
I am writing here because I am trying to develop a VBA code in order to execute an autofilter based on the criteria specified by the user.
The user must specify in cells Cells(2, 18) and Cells(3, 18) the criteria.
My issue is that it works perfectly in the computer I develop, but it does not work in some users' computers.
One of the criteria is a percentage value. After defining the variable, 80% becomes 0,8 in some users' laptops, but when filtering the data with "0,8", it does not work. But with 0.8, it works perfectly.
A solution that may be suggested is to change the users' settings in Excel - that is not feasible, since I would have to deal with hundreds of users and this is only one report. So it is too much effort for too little.
Another solution that I thought is replacing the comma by a dot not in the User specification, but in the way how the Excel/VBA reads the criteria entered by the user. That means, if the user inserts 80%, Excel will read 0,8, but it will replace comma by a dot. I tried to use the formula replace in Excel, but it did not work. Is there a way of replacing the comma by a do within VBA?
Thanks in advance for any help!
Regards,
Lucas
Bookmarks