WorksheetFunction in Access?

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.
Code:
'Some Excel Code
    Dim cell As Range
    
    For Each cell In ActiveSheet.UsedRange.SpecialCells(xlCellTypeConstants)
        cell = WorksheetFunction.Trim(cell)
    Next cell
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.
 
none for double space, you need to repeat the step:

'double space
while instr(string, " ")<> 0
string = replace(string, " ", "")
wend
 
Thanks for the responses.

It is not that i need a solution to a Trim problem but i wasn't aware that there is another set of functions in Excel which you can utilize and i was wandering if Access has a similar additional set of functions.
To which i was not aware...

Thx!
 

Users who are viewing this thread

Back
Top Bottom