I have a variable "nextnum", nextnum could have a value of 1,2,3,4,5,6, or 7 all the way to 50.
Depending on the value of nextnum I want to give a certain outout, i have it partially done using IF..Else
If NextNum =1 Then
DeptName = "Bloggs"
ElseIF NextNum = 2 Then
DeptName = "joe"
Else
.........................
I don't want to have 50 Else..If's to achieve this. I suspect I should try to use an array to hold the values.
Has anyone a better way of achieving this, if they do can they supply some sample code for it.
Thanks.
Depending on the value of nextnum I want to give a certain outout, i have it partially done using IF..Else
If NextNum =1 Then
DeptName = "Bloggs"
ElseIF NextNum = 2 Then
DeptName = "joe"
Else
.........................
I don't want to have 50 Else..If's to achieve this. I suspect I should try to use an array to hold the values.
Has anyone a better way of achieving this, if they do can they supply some sample code for it.
Thanks.