Results 1 to 3 of 3

Thread: Search the DGV for parts of words

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Sep 2014
    Posts
    19

    Search the DGV for parts of words

    For example in the DGV in the first column followed by the words, Nissan2,
    Porsche, Nissan, Honda, Mitsubishi, Nissan, Nissan27., you must find all
    coincidences with the word Nissan, I thought somehow insert an asterisk or
    question mark, but not looking for how to find coincidences?
    Code:
     Dim y As Integer = 0
            For i As Integer = 0 To DataGridView1.Rows.Count - 1
                If DataGridView1.Rows(i).Cells(2).Value = "Nissan" + "*" Then
    
                    y += 1
    
                End If
            Next
            DataGridView9.Rows(1).Cells(6).Value = y

  2. #2
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: Search the DGV for parts of words

    use
    Code:
    if DataGridView1.Rows(i).Cells(2).Value.ToString.contains("Nissan") then

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Sep 2014
    Posts
    19

    Re: Search the DGV for parts of words

    kleinma,
    Thank you!

Posting Permissions

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



Click Here to Expand Forum to Full Width