我目前正在制定一个用户窗体来创建一个公司用户发送到我的部门的订单。如何添加一个标签和文本框基于在excel中的用户窗体上的组合框选择
目前我陷入了僵局,因为我正在努力解决以下问题。
我有一个组合框,它有我们业务提供的产品列表。基于选择,我希望能够添加要求用户输入数据的标签和文本框。
如果选择在组合框中,然后 输入名称,要求的日期,用户等位置
而且这需要具体到组合框的选择。
任何帮助,将不胜感激:)
UPDATE
道歉,因为我没有该功能我没加任何这里是我的代码有任何代码。
Private Sub CommandButton1_Click()
Windows("RFS User Form Mock.xlsm").Visible = True
End Sub
Private Sub LegendDefinition_Change()
LegendDefinition.Locked = True
End Sub
Private Sub RequestList_Change()
Dim i As Long, LastRow As Long
LastRow = Sheets("Definition").Range("A" & Rows.Count).End(xlUp).Row
For i = 2 To LastRow
If Sheets("Definition").Cells(i, "A").Value = (Me.RequestList) Then
Me.DefinitionBox = Sheets("Definition").Cells(i, "B").Value
End If
Next
End Sub
Private Sub RequestList_DropButtonClick()
Dim i As Long, LastRow As Long
LastRow = Sheets("Definition").Range("A" & Rows.Count).End(xlUp).Row
If Me.RequestList.ListCount = 0 Then
For i = 2 To LastRow
Me.RequestList.AddItem Sheets("Definition").Cells(i, "A").Value
Next i
End If
End Sub
Sub UserForm_Initialize()
SiteList.List = Array("Birmingham", "Bristol", "Cardiff", "Chelmsford", "Edinburgh", "Fenchurch Street", "Glasgow", "Guernsey", "Halifax", "Homeworker", "Horsham", "Ipswich", "Jersey", "Leeds", "Leicester", "Lennox Wood", "Liverpool", "Manchester", "Peterborough", "Redhill", "Sunderland", "Madrid")
End Sub
Private Sub VLookUp_Change()
VLookUp.Locked = True
End Sub
代码是否添加了帮助?我会把用户界面的图像,但我没有足够的代表。此外,我正在使用VLookup与相同的组合框。该组合框称为RequestList。 –