กดปุ่มค้นหาแล้วขึ้นแบบนี้คืออะไรค่ะ
Posted: Fri Oct 06, 2017 11:30 am
กดปุ่มค้นหาแล้วขึ้นแบบนี้คืออะไรค่ะ? form2
Code: Select all
Private Sub BTsearch_Click()
Dim txt As String
On Error Resume Next
'Err.Clear
Dim nRow As String
nRow = Sheet9.Columns(1).Find(txtsearch.Text).Row
If Err.Number = 91 Then
TextBox1.RowSource = "txtsearch.Text"
MsgBox "ไม่พบข้อมูล"
End If
txt = Cells(nRow, 1) & vbCrLf & Cells(nRow, 2) & vbCrLf & Cells(nRow, 3) _
& vbCrLf & Cells(nRow, 4)
TextBox1.Value = txt
End Sub