Dagda
08-31-2008, 06:01 PM
Alright, so I'm fairly sure this is a simple problem, but I have a program for excel that is supposed to return a number corresponding to the parts composing a small string. However, so far it will only return 1. Here's the beginning of it.
Function APValue(ABILITYNAME) As Integer
Dim APReturned
If IsNumeric(InStr(LCase(ABILITYNAME), LCase("Rally"))) Then
APReturned = 1
Else
If IsNumeric(InStr(LCase(ABILITYNAME), LCase("Ten Thousand Stars"))) Then
APReturned = 1
Else
If IsNumeric(InStr(LCase(ABILITYNAME), LCase("Music of Makers"))) Then
APReturned = 2
Else
If IsNumeric(InStr(LCase(ABILITYNAME), LCase("Music of the Dead"))) Then
APReturned = 2
Else
If IsNumeric(InStr(LCase(ABILITYNAME), LCase("Spellsinger"))) Then
APReturned = 4
Else
If IsNumeric(InStr(LCase(ABILITYNAME), LCase("Virtuoso"))) Then
APReturned = 4
Else
If IsNumeric(InStr(LCase(ABILITYNAME), LCase("Warchanter"))) Then
APReturned = 4
Else
If IsNumeric(InStr(LCase(ABILITYNAME), LCase("Lifting the Veil"))) Then
APReturned = 2
Else
If IsNumeric(InStr(LCase(ABILITYNAME), LCase("Vermin Empathy"))) Then
APReturned = 2
Else
If IsNumeric(InStr(LCase(ABILITYNAME), LCase("Adept of Wind"))) Then
APReturned = 2
Else
If IsNumeric(InStr(LCase(ABILITYNAME), LCase("Disciple of Breezes"))) Then
APReturned = 1
Else
If IsNumeric(InStr(LCase(ABILITYNAME), LCase("Master of Thunder"))) Then
APReturned = 3
Else
If IsNumeric(InStr(LCase(ABILITYNAME), LCase("Adept of Rock"))) Then
APReturned = 2
Else
If IsNumeric(InStr(LCase(ABILITYNAME), LCase("Disciple of Pebbles"))) Then
APReturned = 2
Else
If IsNumeric(InStr(LCase(ABILITYNAME), LCase("Master of Stone"))) Then
APReturned = 3
Else
If IsNumeric(InStr(LCase(ABILITYNAME), LCase("Adept of Flame"))) Then
APReturned = 2
Else
If IsNumeric(InStr(LCase(ABILITYNAME), LCase("Disciple of Candles"))) Then
APReturned = 1
Else
If IsNumeric(InStr(LCase(ABILITYNAME), LCase("Master of Bonfires"))) Then
APReturned = 3
Else
If IsNumeric(InStr(LCase(ABILITYNAME), LCase("Disciple of Puddles"))) Then
APReturned = 1
Else
If IsNumeric(InStr(LCase(ABILITYNAME), LCase("Adept of Rain"))) Then
APReturned = 2
Else....
et cetera. It's a very long program, primarily because there's an incredible number of abilities in the game I'm trying to make this for. (Yeah, I'm a lame gamer, but I'm not shy about it. XD)
Regardless, I do have all the proper End Ifs, (and there's a lot. >.<) I'm just really getting tired of seeing only 1s.
Help?
Function APValue(ABILITYNAME) As Integer
Dim APReturned
If IsNumeric(InStr(LCase(ABILITYNAME), LCase("Rally"))) Then
APReturned = 1
Else
If IsNumeric(InStr(LCase(ABILITYNAME), LCase("Ten Thousand Stars"))) Then
APReturned = 1
Else
If IsNumeric(InStr(LCase(ABILITYNAME), LCase("Music of Makers"))) Then
APReturned = 2
Else
If IsNumeric(InStr(LCase(ABILITYNAME), LCase("Music of the Dead"))) Then
APReturned = 2
Else
If IsNumeric(InStr(LCase(ABILITYNAME), LCase("Spellsinger"))) Then
APReturned = 4
Else
If IsNumeric(InStr(LCase(ABILITYNAME), LCase("Virtuoso"))) Then
APReturned = 4
Else
If IsNumeric(InStr(LCase(ABILITYNAME), LCase("Warchanter"))) Then
APReturned = 4
Else
If IsNumeric(InStr(LCase(ABILITYNAME), LCase("Lifting the Veil"))) Then
APReturned = 2
Else
If IsNumeric(InStr(LCase(ABILITYNAME), LCase("Vermin Empathy"))) Then
APReturned = 2
Else
If IsNumeric(InStr(LCase(ABILITYNAME), LCase("Adept of Wind"))) Then
APReturned = 2
Else
If IsNumeric(InStr(LCase(ABILITYNAME), LCase("Disciple of Breezes"))) Then
APReturned = 1
Else
If IsNumeric(InStr(LCase(ABILITYNAME), LCase("Master of Thunder"))) Then
APReturned = 3
Else
If IsNumeric(InStr(LCase(ABILITYNAME), LCase("Adept of Rock"))) Then
APReturned = 2
Else
If IsNumeric(InStr(LCase(ABILITYNAME), LCase("Disciple of Pebbles"))) Then
APReturned = 2
Else
If IsNumeric(InStr(LCase(ABILITYNAME), LCase("Master of Stone"))) Then
APReturned = 3
Else
If IsNumeric(InStr(LCase(ABILITYNAME), LCase("Adept of Flame"))) Then
APReturned = 2
Else
If IsNumeric(InStr(LCase(ABILITYNAME), LCase("Disciple of Candles"))) Then
APReturned = 1
Else
If IsNumeric(InStr(LCase(ABILITYNAME), LCase("Master of Bonfires"))) Then
APReturned = 3
Else
If IsNumeric(InStr(LCase(ABILITYNAME), LCase("Disciple of Puddles"))) Then
APReturned = 1
Else
If IsNumeric(InStr(LCase(ABILITYNAME), LCase("Adept of Rain"))) Then
APReturned = 2
Else....
et cetera. It's a very long program, primarily because there's an incredible number of abilities in the game I'm trying to make this for. (Yeah, I'm a lame gamer, but I'm not shy about it. XD)
Regardless, I do have all the proper End Ifs, (and there's a lot. >.<) I'm just really getting tired of seeing only 1s.
Help?