Hello folks.
I am trying to program a classification function in excel 2007 on win XP. the classification works such that I have to compare input to preset curves and find the lowest curve that the input does not cross.
This manifests in taking 9 cells as input and looping them through some checking algorithms to produce an output.
Unfortunately i run into problems with my input. I have tried several versions, one of which is:
which returns a "#NAME?" when called.
As I am new to VBA and have only the first clue as to error management, I tried remake this into a sub
where the cells are the ones to be supplied as argument for the function.
When stepped through this throws an "Run-time Error '13' incompatible types" without a marker.
My questions:
1) Is this a valid way to debug? Are these equivalent code snippets?
2) What part of the code throws the error '13'? Is it perhaps further into the code?
3) How is a better way to use 9 non-joined cells as a range/double argument in a function?
Grateful for your help
I am trying to program a classification function in excel 2007 on win XP. the classification works such that I have to compare input to preset curves and find the lowest curve that the input does not cross.
This manifests in taking 9 cells as input and looping them through some checking algorithms to produce an output.
Unfortunately i run into problems with my input. I have tried several versions, one of which is:
Code:
function Rating( ParamArray rLevels() As Variant)
As I am new to VBA and have only the first clue as to error management, I tried remake this into a sub
Code:
Sub Rating()
Dim rLevels() as Variant
rLevels = Range("C13, C16, C19, C22, C25, C28, C31, C34, C37").Select
When stepped through this throws an "Run-time Error '13' incompatible types" without a marker.
My questions:
1) Is this a valid way to debug? Are these equivalent code snippets?
2) What part of the code throws the error '13'? Is it perhaps further into the code?
3) How is a better way to use 9 non-joined cells as a range/double argument in a function?
Grateful for your help