我有一个带有语言 ID 复选框的用户表单。选中后,将填充工作表“输出”上的一个单元格。这是代码:
Private Sub btnSubmit_Click()
Sheets("output").Activate
NextRow = Application.WorksheetFunction.CountA(Range("A:A")) + 1
If cbxEnUs Then Cells(NextRow, 3) = "3 - en-us"
If cbxFr Then Cells(NextRow, 4) = "3 - fr"
If cbxIt Then Cells(NextRow, 5) = "3 - it"
Sheets("input").Activate
我想将以下数据验证(来自记录的宏)应用于接收值的每个单元格。
With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertInformation, _
Operator:=xlBetween, Formula1:="3 - en-us,2 - en-us,1 - en-us"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = "Incorrect value"
.InputMessage = "3 = action req'd" & Chr(10) & "2 = in progress" & Chr(10) & "1 = complete"
.ErrorMessage = "Please review valid input values" & Chr(10) & "and try again"
.ShowInput = True
.ShowError = True
End With
如何连接这两段代码?