|
おはようございます。
ミスがありました。
>Sub test()
> Dim myDic As Object
> Dim myR As Range
> Dim r As Range
> Dim i As Long
> Dim A As Variant, B As Variant
>
> Set myDic = CreateObject("Scripting.Dictionary")
> Set myR = Selection
> For Each r In myR
> myDic(r.Interior.ColorIndex) = myDic(r.Interior.ColorIndex) + 1
> Next
> A = myDic.keys
> B = myDic.Items
> With Sheets("Sheet2")
.Cells.Clear ’追加
> For i = 0 To myDic.Count - 1
> With .Cells(i + 1, 1)
> .Interior.ColorIndex = A(i)
> .Offset(, 1).Value = B(i)
> End With
> Next
> End With
>End Sub
|
|