ちなみに(1)のコードは出来ており下記になります。 Private Sub CommandButton1_Click() Dim myData, i, j Dim ws As Worksheet Dim rf As Range Application.ScreenUpdating = False myData = Me.TextBox1.Text If myData = "" Then MsgBox "建物CDが未入力です。" & vbCrLf & "入力してください。" Exit Sub End If For Each ws In Worksheets
With ws
Set rf = .Range("A:A").Find(What:=TextBox1.Text, _ LookIn:=xlValues, LookAt:=xlWhole)
If Not rf Is Nothing Then Exit For
End With
Next
If Not rf Is Nothing Then Label3.Caption = rf.Offset(, 1).Value Else MsgBox "該当する建物CDがありません。", vbExclamation End If