If Not D.EXISTS(Application.Phonetic(.Rows(I))) Then
Set D(Application.Phonetic(.Rows(I))) = .Rows(I) ''字典物件的內容: 為Range
Else
Set D(Application.Phonetic(.Rows(I))) = Union(D(Application.Phonetic(.Rows(I))), .Rows(I))
'Union 方法 傳回兩個或多個範圍的合併範圍。
End If
Next
For Each D_Item In D.ITEMS '依序傳回 字典物件的內容
With D_Item '字典物件的內容: 為Range
If .Rows.Count > 1 Then '
For I = 2 To .Rows.Count '從第2列開始
.Rows(I).Interior.Color = vbYellow
.Rows(I).Cells(4) = 0
.Rows(I).Cells(4).Font.Color = vbRed
Next
End If
End With
Next
End With
End Sub
複製代碼
作者: b9208 時間: 2013-4-14 22:30
回復 2#GBKEE
謝謝版主
執行ok
不了解Exists & Phonetic 函數,上網查也不解。
不知道下面句子含義
If Not D.EXISTS(Application.Phonetic(.Rows(I))) Then
Set D(Application.Phonetic(.Rows(I))) = .Rows(I)
Else
Set D(Application.Phonetic(.Rows(I))) = Union(D(Application.Phonetic(.Rows(I))), .Rows(I))
End If
以上謝謝作者: b9208 時間: 2013-4-14 23:02