choubix
05-05-2008, 10:10 AM
hello!
I am working on an interpolation VBA macro.
I need to use the "match" function in the macro.
right now I have this:
Dim CurrTest As Variant
Dim i As Integer
For i = 1 To Range("Time_Steps_Increments").Count
CurrTest = Range("Time_Steps_Increments").Cells(i)
Cells(33 + i, 11) = "=Match("CurrTest", Test)"
Next i
that returns an "expected: end of statement"
I believe this is due to me using "CurrTest"as a parameter in the function.
CurrTest is defined in VBA code but not in the Spreadsheet...
maybe a problem with the concatenation too.
right now I am printing the result on screen to check whether it is correct.
later I'll have to store the result of Match in "j" (and use it too loop)
so my questions are:
- how do I solve the "expected: end of statement"?
- how can I use the worksheet function correctly in VBA?
Thank you for your help :)
+++
Alex
I am working on an interpolation VBA macro.
I need to use the "match" function in the macro.
right now I have this:
Dim CurrTest As Variant
Dim i As Integer
For i = 1 To Range("Time_Steps_Increments").Count
CurrTest = Range("Time_Steps_Increments").Cells(i)
Cells(33 + i, 11) = "=Match("CurrTest", Test)"
Next i
that returns an "expected: end of statement"
I believe this is due to me using "CurrTest"as a parameter in the function.
CurrTest is defined in VBA code but not in the Spreadsheet...
maybe a problem with the concatenation too.
right now I am printing the result on screen to check whether it is correct.
later I'll have to store the result of Match in "j" (and use it too loop)
so my questions are:
- how do I solve the "expected: end of statement"?
- how can I use the worksheet function correctly in VBA?
Thank you for your help :)
+++
Alex