hi,
you could use few IF then and branch to different subroutine OR use SELECT CASE.

Code:
If (AdVal>0) and (AdVal<10) then GOSUB Routine1
If (AdVal>10) and (AdVal<20) then GOSUB Routine2
' etc etc etc