+ Reply to Thread
Results 1 to 4 of 4

filter out the array

Hybrid View

  1. #1
    Registered User
    Join Date
    12-17-2008
    Location
    Singapore
    MS-Off Ver
    2002
    Posts
    71

    filter out the array

    hi I have a array which take the value from the column J. izit possible to have a check in column B. If one of the value in column J was founded in column B(cell B3:B50), it will not put the value into the array.

    ReDim List(z)
    For a = 1 To z
    List(a) = Cells(a, 10)
    Next a

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: filter out the array

    You can use the Find method to try to locate a given value from col J in the range of interest in col B. If you find it, don't add it to the array.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    12-17-2008
    Location
    Singapore
    MS-Off Ver
    2002
    Posts
    71

    Re: filter out the array

    how to use the find method in my example? or is there any example for me to refer to ?
    Last edited by kaffal; 03-29-2009 at 06:35 AM.

  4. #4
    Registered User
    Join Date
    09-01-2008
    Location
    pune
    MS-Off Ver
    Excel 2021
    Posts
    12

    Re: filter out the array

    Hope this will help you

    Private Sub CommandButton1_Click()
    
    ReDim j(100)
    
    Count = 0
    l = 1
    While Worksheets("Sheet1").Cells(l, 2) <> ""
    l = l + 1
    Count = Count + 1
    Wend
    
    k = 1
    ce = 1
    While Worksheets("Sheet1").Cells(k, 10) <> ""
    k = k + 1
    ce = ce + 1
    Wend
    
    For n = 1 To ce
        i = 1
        nonmatch = 0
        While Worksheets("Sheet1").Cells(i, 2).Value <> ""
             If (Worksheets("Sheet1").Cells(n, 10).Value <> Worksheets("Sheet1").Cells(i, 2).Value) Then
                nonmatch = nonmatch + 1
               
            End If
             i = i + 1
        Wend
      
      If (Count = nonmatch) Then
            j(n) = Worksheets("Sheet1").Cells(n, 10)
          MsgBox j(n)
       End If
    
    Next
    
    
    
    End Sub

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1