#NUM!

G

gregork

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
 
R

Rob van Gelder

How about something like:

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

bcmiller

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
 
G

gregork

Thanks for the replies.Is there a way of writing this code so that it covers
all the text boxes in the user form ( there's about 20) and all the cells
the text boxes use for values(range AH34:AL52).

Cheers
gregork
 
Top