Hi,
i have been trying to handle the error in vba for last two days and have tried all the possible option i know but unfortunately not got rid of this error till now. below is the code-
if not iserror(Application.WorksheetFunction.Rank(Cells(a, 24), Range("x:x"))) then
Activecell.value = Application.WorksheetFunction.Rank(Cells(a, 24), Range("x:x"))
else
activecell.value = "NA"
end if
i just want rank value in Activecell and if there is any error or cell is blank in corosponding X column, function should return "NA" for this cell. but given code generates error - "Run time error 1004"
"Unable to get the rank property of the worksheetFunction class"
whenever it encounters a blank cell, otherwise it's working fine.
Please help.........
Thanks
i have been trying to handle the error in vba for last two days and have tried all the possible option i know but unfortunately not got rid of this error till now. below is the code-
if not iserror(Application.WorksheetFunction.Rank(Cells(a, 24), Range("x:x"))) then
Activecell.value = Application.WorksheetFunction.Rank(Cells(a, 24), Range("x:x"))
else
activecell.value = "NA"
end if
i just want rank value in Activecell and if there is any error or cell is blank in corosponding X column, function should return "NA" for this cell. but given code generates error - "Run time error 1004"
"Unable to get the rank property of the worksheetFunction class"
whenever it encounters a blank cell, otherwise it's working fine.
Please help.........
Thanks