You probably mean:

[VBA]
dist = IIf(dist > 5, dist, 0) & 10 ^ (4 - ((dist - 1) \ 5))

[/VBA]

instead of that 'select case' code.