stuartgb100
Active Member
- Joined
- May 10, 2015
- Messages
- 322
- Office Version
- 2021
- Platform
- Windows
Hi,
I have some code from this site that removes leading spaces from most cells in my data, but not all.
What sort of thing could cause these 'unknown' spaces and how do i deal with them please ?
Here's the code:
Sub RemoveLeadingTrailingSpaces()
' hiker95, 02/26/2016, ME9242394
With ActiveSheet
With .Range("C8:C24")
.Value = Evaluate("IF(ISTEXT(" & .Address & "),TRIM(" & .Address & "),REPT(" & .Address & ",1))")
End With
End With
End Sub
Thanks.
I have some code from this site that removes leading spaces from most cells in my data, but not all.
What sort of thing could cause these 'unknown' spaces and how do i deal with them please ?
Here's the code:
Sub RemoveLeadingTrailingSpaces()
' hiker95, 02/26/2016, ME9242394
With ActiveSheet
With .Range("C8:C24")
.Value = Evaluate("IF(ISTEXT(" & .Address & "),TRIM(" & .Address & "),REPT(" & .Address & ",1))")
End With
End With
End Sub
Thanks.