我在主程式中,動態新增了 UserForm,然後動態新增程式碼,其中有用到 Class ,請問我要如何將要用的變數值帶入 Class3 中 ?
主程式
.InsertLines i + 2, "Set Class_obj3.MyNewComboBoxList1 = Controls(""The_Start_Month_Select"")"
.InsertLines i + 3, "Set Class_obj3.MyNewComboBoxList2 = Controls(""The_End_Month_Select"")"
Class 3 的部份如下:
Public WithEvents MyNewComboBoxList1 As MSForms.ComboBox
Public WithEvents MyNewComboBoxList2 As MSForms.ComboBox
Private Sub MyNewComboBoxList1_Change()
XXXXXXXX
End Sub |