Hi Guys,
Any suggestion on how to detect or search for an extra space?
sample 1: " excel forum" - extra space in front
sample 2: "excel forum" - extra space in the middle of two words
sample 3: "excel forum " - extra space at the end
Hi Guys,
Any suggestion on how to detect or search for an extra space?
sample 1: " excel forum" - extra space in front
sample 2: "excel forum" - extra space in the middle of two words
sample 3: "excel forum " - extra space at the end
Try something like this...
Application.Trim removes extra spaces from the beginning, middle, and\or end of a text string.![]()
Please Login or Register to view this content.
Last edited by AlphaFrog; 04-05-2017 at 10:13 PM.
Surround your VBA code with CODE tags e.g.;
[CODE]your VBA code here[/CODE]
The # button in the forum editor will apply CODE tags around your selected text.
What if I want to run it to the whole worksheet and then identify the cell that have extra space?
..........................deleted
Last edited by Sintek; 04-06-2017 at 07:29 AM.
Good Luck...
I don't presume to know what I am doing, however, just like you, I too started somewhere...
One-day, One-problem at a time!!!
If you feel I have helped, please click on the [★ Add Reputation] to left of post window...
Also....Add a comment if you like!!!!
And remember...Mark Thread as Solved...
Excel Forum Rocks!!!
Here you go...This amended code of Alphafrog should work.
![]()
Please Login or Register to view this content.
Last edited by Sintek; 04-06-2017 at 07:53 AM.
Try
![]()
Please Login or Register to view this content.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks