vba将下拉列表插入到outlook中的excel单元格中

时间:2014-11-13 09:29:17

标签: excel vba outlook

我正在尝试将下拉/验证列表插入到第25列的下一个可用行中。

我在以下行收到编译错误:Formula1:=Join(MyList, ",")

    Const Delete As Integer = 3
    Const Add As Integer = 4
    Const xlValidateList As Integer = 5
    Const AlertStyle As Integer = 6
    Const xlValidAlertStop As Integer = 7
    Const Operator As Integer = 8
    Const xlBetween As Integer = 9
    Const Formula1 As Integer = 10
    Const Join As Integer = 11

 intRow4 As Integer, _
intRow4 = excWks4.UsedRange.Rows.Count + 1

         Dim MyList(3) As String
                               MyList(0) = "Yes"
                               MyList(1) = "No"
                               MyList(2) = "Declined"
                               With excWks4.Cells(intRow4, 25).Validation
                               .Delete
                               .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, _
                               Operator:=xlBetween, Formula1:=Join(MyList, ",")
                               End With

我想它是因为展望不支持,有人可以告诉我如何让它发挥作用吗?感谢

1 个答案:

答案 0 :(得分:0)

删除/评论您的所有Const作业。直接使用xl枚举很好,但定义与Validation参数同名的变量可能不是一个好主意。