VBA中MultiPages中的Combobox_Change函数

时间:2016-02-07 02:00:41

标签: excel vba excel-vba combobox

我有多用户表单。我创建了一个按钮,当我点击这个按钮时,它会添加一个Combobox和一些标签和文本框。后来我需要为这个Combobox创建一个更改功能。但是,我无法使用Combobox的名称。

.picker__date-display, .picker__weekday-display{
    background-color: #CCC;
}

然后我需要使用按钮点击创建的名称创建以下功能。但是,ndc_no_textbox_pages(1)_Change()会出错。

Private Sub add_ndc_button_Click()
ndc_page_count = Me.ndc_pages.Pages.Count
Me.ndc_pages.Pages.Add ("NDC " & ndc_page_count + 1)

Set ndc_no_textbox_pages(ndc_page_count + 1) = ndc_pages.Pages(ndc_page_count).Controls.Add("Forms.ComboBox.1")
With ndc_no_textbox_pages(ndc_page_count + 1)
  .Top = first_c_y + space_between_rows
  .Left = first_c_x + space_between_columns
  .Height = text_height
  .Width = text_width
  .RowSource = "=ProductMasterData!F2:F19"
End With
End Sub

0 个答案:

没有答案