PDA

View Full Version : [SOLVED] Array question



snoopies
08-29-2005, 04:54 PM
Hi,

Below is the code which will delete the cellcontents with words appear in the array..


For j = LBound(MyArr) To UBound(MyArr)
If xTemp = MyArr(j) Then
DelRow = True
Exit For
End If
... Next j

If DelRow = True Then
Cells(i, ActiveCell.Column - 1).ClearContents
End If
End If
Next i

Now, if the value of (MyArr) is "ABC", but the value of xTemp is "ABC,EFG",
I also want to clear the content of it but the macro only recognise the word "ABC" only... how should I modify it?

Thanks!

geekgirlau
08-29-2005, 05:06 PM
For j = LBound(MyArr) To UBound(MyArr)
If InStr(1, xTemp, MyArr(j)) > 0 Then
Cells(i, ActiveCell.Column - 1).ClearContents
Exit For
End If
Next j

snoopies
09-02-2005, 07:17 AM
THANKS! It Works!