I would like to create an excel function to check the value of a cell and if is equal to 180 - 395 the cell will
be populated with 1;if is equal to 730 - 100 the cell will be populated with 2; if is equal to 120 - 500 the cell will be populated with a 9.
I tried the vb code below but it does not return the value back to the calling cell.
Function xParse(myNum)
Dim pNum As Integer
If myNum = "180 - 395" Then
pNum = 1
myNum = pNum
End If
If myNum = "120 - 500" Then
myNum = "9"
End If
End Function
Any suggestions? Or guidance.
Thank you
be populated with 1;if is equal to 730 - 100 the cell will be populated with 2; if is equal to 120 - 500 the cell will be populated with a 9.
I tried the vb code below but it does not return the value back to the calling cell.
Function xParse(myNum)
Dim pNum As Integer
If myNum = "180 - 395" Then
pNum = 1
myNum = pNum
End If
If myNum = "120 - 500" Then
myNum = "9"
End If
End Function
Any suggestions? Or guidance.
Thank you