Guus2005
AWF VIP
- Local time
- Today, 10:52
- Joined
- Jun 26, 2007
- Messages
- 2,642
I came accross this little gem.
Apparently in Excel there are two(?) sets of functions available.
Regular functions such as Trim() but also WorksheetFunction.Trim()
The first removes all leading and trailing spaces.
The second does the same and additionaly removes all double spaces in the string and replaces it with single spaces.
See the code below.
You can use these functions in Access using the Excel object but is there an Access equivalent?
I think not but just asking...
Gr, Guus.
Apparently in Excel there are two(?) sets of functions available.
Regular functions such as Trim() but also WorksheetFunction.Trim()
The first removes all leading and trailing spaces.
The second does the same and additionaly removes all double spaces in the string and replaces it with single spaces.
See the code below.
Code:
'Some Excel Code
Dim cell As Range
For Each cell In ActiveSheet.UsedRange.SpecialCells(xlCellTypeConstants)
cell = WorksheetFunction.Trim(cell)
Next cell
I think not but just asking...
Gr, Guus.