全部。我在工作表中有一个名为 lookupMisc 的表,名为periodNo (A)和periodName (B),具有以下值。
A B
1 09:00
2 10:00
3 11:00
4 12:00
5 13:00
6 14:00
7 15:00
8 16:00
9 17:00
代码如下:
For i = 1 To ws_misc.Range("periodNo").Rows.Count
CombinedName = periodNo(i, 1) & " - " & periodName(i, 1)
cbo_period.AddItem CombinedName
Next i
并且 thsi 生成:
现在您会注意到右侧有一个Length ( txt_length ) 文本字段。基本上,我正在尝试根据该期间的条目创建一种动态验证形式。以下是案例:
If user selects Then
1 - 09:00 Length can only accept values from 1-9
2 - 10:00 Length can only accept values from 1-8
3 - 11:00 Length can only accept values from 1-7
4 - 12:00 Length can only accept values from 1-6
5 - 13:00 Length can only accept values from 1-5
6 - 14:00 Length can only accept values from 1-4
7 - 15:00 Length can only accept values from 1-3
8 - 16:00 Length can only accept values from 1-2
9 - 17:00 Length can only accept values from 1-1
我将如何实现这一目标?