返回列表 上一主題 發帖

[發問] 要怎麼傳遞變數值到 Class

[發問] 要怎麼傳遞變數值到 Class

我在主程式中,動態新增了 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

回復 1# C.F
附檔看看,然後再舉個實際例子(什麼變數在哪,要給誰用,怎麼用)會比較清楚

TOP

        靜思自在 : 忘功不忘過,忘怨不忘恩。
返回列表 上一主題