dim data as date
data=trim(MyArray(I))
i can have n item array:
9/12/2021
or
12/04/20020
or
"" (blank=
in first case i need to format(dd/mm/yyyy)
in other case trap the error with data="31/12/9999"
TRAP error data...
-
- Administrator
- Posts: 78446
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: TRAP error data...
Air code:
Code: Select all
If Trim(MyArray(I)) = "" Then
data = #12/31/9999"
Else
data = DateValue(Trim(MyArray(I)))
End If
Best wishes,
Hans
Hans
-
- PlatinumLounger
- Posts: 4353
- Joined: 26 Apr 2010, 17:36
Re: TRAP error data...
tested work!HansV wrote: ↑21 Apr 2021, 16:59Air code:
Code: Select all
If Trim(MyArray(I)) = "" Then data = #12/31/9999" Else data = DateValue(Trim(MyArray(I))) End If
-
- 5StarLounger
- Posts: 964
- Joined: 08 Nov 2012, 17:54
Re: TRAP error data...
Hi,
Apparently, testing for 0 length quicker. Not tested it though.
https://www.aivosto.com/articles/stringopt.html#empty
Lisa
Apparently, testing for 0 length quicker. Not tested it though.
https://www.aivosto.com/articles/stringopt.html#empty
Lisa