Your problem is quite simple: you are mixing garlic with oranges. You are looking for a string
(",") inside a cell that contains a non-string value.
I would bet high that the prices in column F are formatted as number. Result: Excel searches the string ",", finds none to replace and returns no error or makes any changes to the spreadsheet.
For your code to work without any changes, just turn the values into strings (open the cell and insert a single quote '
at the beginning, before the value; does not need space. That is: instead of 2,39
, place '2,39
, and so on. Voilà!
That is, the macro works; just doesn’t do what you want.
If you just want to change the format so that the decimals are marked by a dot and the thousands' squares are marked by a comma, you have to change the way the decimals are marked, not the values contained.
I can only imagine two reasons to do this: an international presentation or using a google sheet.
If you need to paste in a Google spreadsheet, I think this conversion is already done automatically. For an international presentation, just search how to change decimal and thousands markup in Excel -- but it is recommended to tinker with it VERY carefully, because you can generate compatibility issues on other computers, and both you and other users (if the computer is used by other people) may end up creating confusion in values reaching the order of thousands of reais!
You can format the entire column in Excel as number with decimal divisor "." , manually in Excel and without VBA. But if you want to use VBA see the function Format
– danieltakeshi