|
▼tk さん:
こんにちは。
Set_listの一部を変更して
標準モジュールに
変数とListSetを追加してみてください。
>>Sub Set_list()
>>Dim a
>>Dim dic As Object
>>Dim myRange As Range, r As Range
>>
>> Set dic = CreateObject("Scripting.Dictionary")
>> ReDim a(1)
>> dic("コマ") = "個数"
> For i = 0 To 10
> dic(Chr(Asc("a") + i)) = 0 'コマ
> Next
>> Set myRange = Range("a1:z30")
>> For Each r In myRange
>> If r.Text <> "" Then
>> dic(r.Text) = Application.CountIf(myRange, r.Text) 'key別個数
>> End If
>> Next
' ********************************************
v1 = dic.keys
v2 = dic.items
Set dic = Nothing
'-----個数出力
Application.OnTime Now(), "ListSet"
' ********************************************
>>End Sub
標準モジュールに
Option Explicit
Public v1 As Variant
Public v2 As Variant
Public Sub ListSet()
With UserForm1.ListBox1
.Clear
.List = Application.Transpose(Array(v1, v2))
End With
End Sub
|
|