| 
    
     |  | オートフィルターを使ってデータ検索する時に、*を使って何々を含むと言う検索条件にしたいのだが、テキストBOXに書き込む時常に*を前後に入れなければならないので自動的に*がはいるプログラムにしたい。 Private Sub CommandButton1_Click()
 
 Dim 区分 As String, 部品番号 As String, 仕様 As String, 仕様2 As String
 Dim 備考 As String, 単位 As String
 
 Range("A2").Select
 Selection.AutoFilter
 If CheckBox1.Value = True Then
 If ComboBox1.Value <> "" Then
 区分 = ComboBox1.Text
 End If
 Selection.AutoFilter Field:=2, Criteria1:=区分
 End If
 If CheckBox2.Value = True Then
 If TextBox1.Value <> "" Then
 部品番号 = TextBox1.Text
 End If
 Selection.AutoFilter Field:=5, Criteria1:=部品番号
 End If
 If CheckBox3.Value = True Then
 If TextBox2.Value <> "" Then
 仕様 = TextBox2.Text
 仕様2 = TextBox3.Text
 End If
 Selection.AutoFilter Field:=6, Criteria1:=仕様, Operator:=xlAnd, _
 Criteria2:=仕様2
 End If
 End Sub
 
 宜しく願い致します。
 
 
 |  |