I couldn't find anything on this and ended up writing a nested if to do it, but would still like to know if it is possible. What I was after was to test both w and h together for true but could not get it to test for the h. It kept finding the first w that was true and returning that value instead of looking at h. Is it possible with a case select to test for both?
Code:
Public Function index(cr As Integer, h As Integer, pr As Integer, w As Integer) As Integer
Dim g As Integer
If IsNull(h) Then '''test for null, if so asign a value'''
g = 4 '''test for 4 instead of null'''
Else
g = h
End If
Select Case w And g
Case w = 5 And g = 1
index = 6
Case w = 5 And g = 2
index = 5
Case w = 5 And g = 1
index = 4
Case w = 6 And g = 4
index = 3
Case w = 7 And g = 4
index = 2
Case w = 6 And g = 1
index = 1
Case w = 6 And g = 2
index = 7
Case w = 6 And g = 3
index = 8
Case w = 1 And g = 4
index = 9
Case w = 2 And g = 4
index = 10
Case w = 3 And g = 4
index = 11
Case w = 4 And g = 4
index = 12
Case Else
index = "else"
End Select
End Function
Example, w was 5 and h was 2 would return 6 instead of 5.