ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   #NUM! (https://www.excelbanter.com/excel-programming/303807-num.html)

gregork

#NUM!
 
I use the following code for a user form text box value:

Me.TextBox16.Value = Sheets("Sheet1").Range("aj34").Text

Trouble is the cell "aj34" is part of an array formula and can often
return:"#NUM!"
Is there any way I can get a blank in my text box even when the cell returns
"#NUM!".
As the cell is part of an array I don't think I can stop the "#NUM!" coming
up on the worksheet.

gregorK



Rob van Gelder[_4_]

#NUM!
 
How about something like:

With Sheets("Sheet1").Range("aj34")
Me.TextBox16.Text = IIf(IsError(.Value), "", .Value)
End With

--
Rob van Gelder - http://www.vangelder.co.nz/excel


"gregork" wrote in message
...
I use the following code for a user form text box value:

Me.TextBox16.Value = Sheets("Sheet1").Range("aj34").Text

Trouble is the cell "aj34" is part of an array formula and can often
return:"#NUM!"
Is there any way I can get a blank in my text box even when the cell

returns
"#NUM!".
As the cell is part of an array I don't think I can stop the "#NUM!"

coming
up on the worksheet.

gregorK





bcmiller[_12_]

#NUM!
 
Hi Gregor,

You can use an if and iserror statement on your worksheet to test i
your array formula returns an error. Where it does substitute th
system error message for your user defined error message.

ie: =if(iserror(array_formula),"",array_formula)

This is an easier way than trying to manipulate through code.

HTH

Cheers,

B

--
Message posted from http://www.ExcelForum.com



All times are GMT +1. The time now is 11:25 PM.

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