【问题标题】:vba insert dropdown list into cell in excel from outlookvba从outlook将下拉列表插入excel中的单元格
【发布时间】:2014-11-13 09:29:16
【问题描述】:

我正在尝试将下拉/验证列表插入到第 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

我想它是因为 Outlook 不支持,有人可以告诉我如何让它工作吗?谢谢

【问题讨论】:

    标签: excel vba outlook


    【解决方案1】:

    删除/注释掉您的所有 Const 分配。直接使用 xl 枚举很好,但定义与验证参数同名的变量可能不是一个好主意。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-05-14
      • 1970-01-01
      • 2015-07-14
      • 2016-05-31
      • 1970-01-01
      • 2020-07-24
      相关资源
      最近更新 更多