The Trim function is in the VBA library.
Trim function in excel is not working. When TRIM doesnt work it sometimes means the additional characters arent spaces and the usual suspect is char 160. No formulas required Ti. To fix this we will use the VALUE function along with the TRIM function instead of the above formula.
But after trimming it the space is still there. Also click on the function icon then manually write and search the formula. It usually works amazingly well you simply point the formula at the cell with the issue and it will produce a clean piece of text without any leading or training spaces.
Thats not likely the issue though although you can try seeing whether using VBATrim instead of just Trim makes a difference. But sometimes this still doesnt work. This article will focuses on what to do when the TRIM formula does not work as expected.
Then we have to enter the details as shown in the picture. The above formula removes all leading. An increasingly regular problem is to remove spaces in Excel when TRIM doesnt work.
Click on formula tab Text click on Trim. Check if there is an apostrophe before the text - use F2 on a cell where Trim isnt working. I enter the trimA2 and press enter but leading spaces are still present.
This will first remove extra spaces then count the number of spaces and add one to give the total number of words in the string. Suppose we are the given the data below. We get a new function window showing in below mention pictures.