|
Private Sub CommandButton1_Click() '查询
Image1.Picture = LoadPicture("")
Dim MYRANGE As Range
Dim i As Integer, MyPic$
With Sheets("sheet1")
Set MYRANGE = .Range("A5", .Range("A65536").End(xlUp)).Find(TextBox37.Value)
If Not MYRANGE Is Nothing Then
For i = 1 To 36
Me.Controls("TEXTBOX" & i) = .Cells(MYRANGE.Row, i + 1)
Next i
MyPic = ThisWorkbook.Path & "\照片\" & TextBox37.Text & ".jpg"
If Dir(MyPic) <> "" Then
Image1.Picture = LoadPicture(MyPic)
Image1.PictureSizeMode = 1
End If
Else
MsgBox "没有找到!" & TextBox37
End If
End With
End Sub
|
|