gnaga
Well-known Member
- Joined
- Jul 9, 2002
- Messages
- 748
- Office Version
- 365
- 2016
- 2013
- Platform
- Windows
I am using Trim Function in VBA to remove all spaces in a string stored in a cell.
My piece of code is like this
Also I have tried this
But in both the cases I am getting the value into the variable Adr with the spaces as it is in the cell.
What could be the problem? I am breaking my head on this simple issue.
TIA & Regards
GNaga
My piece of code is like this
Code:
Adr = Application.WorksheetFunction.Trim(Cells(2, Target.Column))
Also I have tried this
Code:
Adr = Trim(Cells(2, Target.Column))
But in both the cases I am getting the value into the variable Adr with the spaces as it is in the cell.
What could be the problem? I am breaking my head on this simple issue.
TIA & Regards
GNaga