Consulting

Results 1 to 3 of 3

Thread: Array question

  1. #1

    Array question

    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!

  2. #2
    Moderator VBAX Master geekgirlau's Avatar
    Joined
    Aug 2004
    Location
    Melbourne, Australia
    Posts
    1,464
    Location
    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

  3. #3
    THANKS! It Works!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •