F fedude Apr 10, 2008 #1 Is there a way I can check to see if a cells formula resolves to #NA. It doesn't appear that ISNA or NA() are available in excel vb
Is there a way I can check to see if a cells formula resolves to #NA. It doesn't appear that ISNA or NA() are available in excel vb
J JP Apr 10, 2008 #2 You can use certain worksheet functions directly in VBA, if there is no VBA equivalent. Just preface them with "Worksheetfunction" for example Sub Clear_ISNA() Dim cell As Excel.Range Application.ScreenUpdating = False For Each cell In Selection If WorksheetFunction.IsNA(cell) = True Then cell.ClearContents Next cell Application.ScreenUpdating = True End Sub HTH, JP
You can use certain worksheet functions directly in VBA, if there is no VBA equivalent. Just preface them with "Worksheetfunction" for example Sub Clear_ISNA() Dim cell As Excel.Range Application.ScreenUpdating = False For Each cell In Selection If WorksheetFunction.IsNA(cell) = True Then cell.ClearContents Next cell Application.ScreenUpdating = True End Sub HTH, JP
I IanKR Apr 10, 2008 #3 Is there a way I can check to see if a cells formula resolves to #NA. It doesn't appear that ISNA or NA() are available in excel vb Click to expand... use WorksheetFunction.IsNA()...
Is there a way I can check to see if a cells formula resolves to #NA. It doesn't appear that ISNA or NA() are available in excel vb Click to expand... use WorksheetFunction.IsNA()...
F fedude Apr 10, 2008 #5 I'm pretty sure that ISNA() is not avaialble as a worksheet function in VB. I need an alternative. application.worksheetfunction.isna() <== does not exist in VB
I'm pretty sure that ISNA() is not avaialble as a worksheet function in VB. I need an alternative. application.worksheetfunction.isna() <== does not exist in VB
D Dave Peterson Apr 10, 2008 #6 You could also look at what's displayed in the cell if lcase(somerange.text) = lcase("#n/a") then or if you're satisfied just looking for any old error: if iserror(somerange.value) then
You could also look at what's displayed in the cell if lcase(somerange.text) = lcase("#n/a") then or if you're satisfied just looking for any old error: if iserror(somerange.value) then
D Dave Peterson Apr 10, 2008 #7 Look again. ISNA() is not available as a worksheet function in VB. Click to expand...
D Dave Peterson Apr 10, 2008 #8 Look again. You may be surprised. I'm pretty sure that ISNA() is not avaialble as a worksheet function in VB. I need an alternative. application.worksheetfunction.isna() <== does not exist in VB Click to expand...
Look again. You may be surprised. I'm pretty sure that ISNA() is not avaialble as a worksheet function in VB. I need an alternative. application.worksheetfunction.isna() <== does not exist in VB Click to expand...
F fedude Apr 10, 2008 #9 OOPS. ISNA() is available. It just didn't show up in my drop-down function list. NA() is not available. Thanks!
OOPS. ISNA() is available. It just didn't show up in my drop-down function list. NA() is not available. Thanks!