| |
▼はじめ さん:
こんばんは。
以下のようにすると抽出されましたが、
>Private Sub CommandButton1_Click()
>Dim result1 As String
>Dim result2 As String
Dim myR As Range
>result1 = "#N/A!"
>On Error Resume Next
>result2 = "#N/A!"
>On Error Resume Next
With ThisWorkbook.Worksheets("sheet2")
Set myR = .Range("A:D")
End With
result1 = Application.WorksheetFunction.VLookup(Val(Me.TextBox1.Value), myR, 2, False)
result2 = Application.WorksheetFunction.VLookup(Val(Me.TextBox1.Value), myR, 3, False)
>On Error GoTo 0
>UserForm2.TextBox1.Text = result1
>UserForm2.TextBox2.Text = result2
>UserForm2.Show
>
>End Sub
|
|