数据验证包括逗号字符 [英] Data Validation to Include Comma Character

查看:181
本文介绍了数据验证包括逗号字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用以下短宏将数据验证指定为字符列表:

I am using the following short macro to assign Data Validation as a list of characters:

Sub DVList()
    With ActiveCell.Validation
        .Delete
        .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
        xlBetween, Formula1:="a,b,c,d"
        .IgnoreBlank = True
    End With
End Sub

宏工程。

我想修改宏以在列表中包含逗号字符。我没有看到如何做,因为逗号是列表分隔符。

I want to modify the macro to include the comma character in the list. I don't see how to do this because the comma is the list separator.

我不得不使用工作表单元格来构建列表?

Am I stuck having to use worksheet cells to build the list??

推荐答案

我可以测试一下,您不能逃避在列表中。

A far as I could test, you can't escape , in list.

但是您可以引用一个范围。您可以创建一个范围(例如,隐藏的表单),填充所有可能的单元格,并使 Formula1:== HiddenSheet!A1:A10

But you can reference a range. You can build a range (in, eg, a hidden sheet), fill cells with all possibilities and make Formula1 := "=HiddenSheet!A1:A10.

这篇关于数据验证包括逗号字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆