Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click Dim strText As String = TextBox1.Text For Each row As DataGridViewRow In DataGridView1.Rows For Each c As DataGridViewCell In row.Cells Dim Data As String = c.Value?.ToString If Data = strText Then 'Visual Basic 2013以前の場合 'MsgBox("列" & c.ColumnIndex + 1 & "と" & "行" & c.RowIndex + 1 & "に存在しています値は" & Data & "です") 'Visual Basic 2015以降ならこう書くほうが楽 MsgBox($"列{c.ColumnIndex + 1}と行{c.RowIndex + 1}に存在しています値は{Data}です") End If Next Next End Sub