3
我想在某種集合,arraylist,
中存儲按鈕,以便我可以動態添加和刪除。vba形狀集合
我試圖使用集合,但似乎它不是選擇,因爲當達到ar.Add()時出現錯誤。
對象不支持此屬性或方法。
Public Sub removeAllFormsWithAdd()
Dim myshape As Shape
Dim ar As Collection
For Each myshape In ActiveSheet.Shapes
If (myshape.FormControlType = xlButtonControl) Then
If (myshape.TextFrame.Characters.Text = "name") Then
ar.Add (myshape)
Debug.Print "next shape:" & myshape.TextFrame.Characters.Text & "-"
End If
End If
Next myshape
End Sub
我該如何得到它?
感謝您的幫助,現在它的工作。 – Gadolin 2010-10-23 12:59:12