If you really can't stand to see the "THEN" statement of an IF...THEN on the same line as the IF, then you *could* change that code to
Function ISODate( dt )
iso = year(dt) & "/" & month(dt) & "/" & day(dt)
If TimeValue(dt) <> 0 Then
iso = iso & " " & TimeValue(dt)
ISODate = "#" & iso & "#"
NOTE CAREFULLY where the End If
is. It is *NOT* where you put it.