我有三个几乎相同的按钮类(只有CellTypes(r)参数不同)
Private Sub TheButton_Click()
Dim kolorTemp, tempI As Double
Dim r As String
colorTemp = GetColor
r = TheButton.Name
TheButton.BackColor = colorTemp
CellTypes(r).color = colorTemp
End Sub
我想再添加一个类,然后我开始徘徊是否有任何方法可以引用TheButton
而无需在代码中多次编写它。就像Me
适用于UserForm
一样。
我知道我可以使用With TheButton
,但如果还有其他方法,我只是在徘徊。