View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default Test if an element of array is empty

rather than:
If .aryPartDes(2) = Empty
try:
If isempty(.aryPartDes(2))
--
Gary''s Student - gsnu200839


"Ryan H" wrote:

How can I test if .aryPartDes(2) has something in it? Note: PartInfo() is a
function, where it looks up the part number "UVOvercoat", and stores a 1 x 4
Range in .aryPartDes(2). If nothing is assigned to .aryPartDes(2) then I get
an error indicated below. Any ideas?


' formetco UV overcoat material
If chkUVOvercoat.Enabled And chkUVOvercoat Then
.aryPartDes(2) = PartInfo("UVOvercoat")
.aryPartQty(2) = .TrimSqFt * Val(tbxQuantity)
End If

' must have minimum $175 order each face: material + overcoat
ERROR If .aryPartDes(2) = Empty Then
If .TrimSqFt * (.aryPartDes(1)(1, 4) + .aryPartDes(2)(1, 4)) < 175 Then
.aryPartDes(1) = PartInfo("FormetcoMinPrice")
.aryPartQty(1) = Val(tbxQuantity)

Erase .aryPartDes(2)
.aryPartQty(2) = 0
End If
Else
If .TrimSqFt * .aryPartDes(1)(1, 4) < 175 Then
.aryPartDes(1) = PartInfo("FormetcoMinPrice")
.aryPartQty(1) = Val(tbxQuantity)
End If
End If
--
Cheers,
Ryan