View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
David McRitchie David McRitchie is offline
external usenet poster
 
Posts: 903
Default Help with Case Please

In general macro comparisons are case sensitive,
and worksheet formulas are case in-sensitive. See
http://www.mvps.org/dmcritchie/excel...tm#sensitivity

Select Case UCase(Level)
---
HTH,
David McRitchie, Microsoft MVP - Excel
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"St@cy" wrote in message ...
Why am I getting an answer of 1 everytime? The function seems to be skipping
the Case programming. What do I need to do to fix this?

Function TabeGECol(Level, Form) As Integer
Dim ColNum As Integer
ColNum = 1
Select Case Level
Case Level = "L"
ColNum = 2
Case Level = "E"
ColNum = 10
Case Level = "M"
ColNum = 18
Case Level = "D"
ColNum = 26
Case Level = "A"
ColNum = 34
End Select
Select Case Form
Case Form = 7
ColNum = ColNum + 0
Case Form = 8
ColNum = ColNum + 2
Case Form = 9
ColNum = ColNum + 4
Case Form = 10
ColNum = ColNum + 6
End Select
TabeGECol = ColNum
End Function