|
▼たかし さん:
チェンジイベント上では、オートフィルターがかけれないようです。
'Private Sub oldComboBox1_Change()
Private Sub ComboBox1_BeforeUpdate(ByVal Cancel As MSForms.ReturnBoolean)
Dim CT2 As Range, Cel As Range, LB2tb() As String
Worksheets("データ1").Activate
If ActiveSheet.AutoFilterMode Then
ActiveSheet.AutoFilterMode = False
End If
Ltw = ComboBox1.List(ComboBox1.ListIndex)
' Range("B1").AutoFilter field:=3, Criteria1:=Ltw
' Range("B1").AutoFilter field:=1, Criteria1:=Ltw
' CE = ActiveSheet.Range("C65536").End(xlUp).Row
CE = ActiveSheet.Range("A65536").End(xlUp).Row
' Set CT2 = Range("U2:U" & CE).SpecialCells(xlCellTypeVisible)
Set CT2 = Range("B2:D" & CE).SpecialCells(xlCellTypeVisible)
ListBox1.Clear
ListBox1.ColumnCount = 3 '追加
' cnt = 0
' For Each Cel In CT2
' On Error Resume Next
' mt = Application.Match(Cel, ListBox1.List, 0)
' If IsError(mt) Or mt = Empty Then
' cnt = cnt + 1
' ReDim Preserve LB2tb(1 To cnt)
' LB2tb(cnt) = Cel
' End If
' ListBox1.List = LB2tb
' Err.Clear
' On Error GoTo 0
' Next
ListBox1.List = CT2.Value
Set CT2 = Nothing
' Erase LB2tb
' Application.ScreenUpdating = True
' Worksheets("読み出し").Activate
End Sub
|
|