We have a winner:
Code:
Public Function XYtoZ(pintX As Integer, pintY As Integer) As Long
    XYtoZ = (400 - pintY) * 801& + pintX + 401
End Function