Hi Savnik,
Looks like a job for select case - see page 129 in . . dare I say . .the manual.