ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   check for #N/A (https://www.excelbanter.com/excel-programming/397005-check-n.html)

rodchar

check for #N/A
 
Hey all,
in VBA how do i check for #N/A? i keep getting a runtime error when code
tries to read this record that has this value.

thanks,
rodchar

JW[_2_]

check for #N/A
 
You can use Application.WorksheetFunction.IsNA to search for only #N/A
errors or use VBA's IsError to search for any errors at all.
rodchar wrote:
Hey all,
in VBA how do i check for #N/A? i keep getting a runtime error when code
tries to read this record that has this value.

thanks,
rodchar



Dave Peterson

check for #N/A
 
Or you could look at the .text property:

if mycell.text = "#N/A" then


rodchar wrote:

Hey all,
in VBA how do i check for #N/A? i keep getting a runtime error when code
tries to read this record that has this value.

thanks,
rodchar


--

Dave Peterson

JW[_2_]

check for #N/A
 
Good point Dave.

Dave Peterson wrote:
Or you could look at the .text property:

if mycell.text = "#N/A" then


rodchar wrote:

Hey all,
in VBA how do i check for #N/A? i keep getting a runtime error when code
tries to read this record that has this value.

thanks,
rodchar


--

Dave Peterson




All times are GMT +1. The time now is 02:08 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com