在VBA中,如何添加一组值并同时输出整个组?
从本质上说,我想做的事情是:
Todays_Date = 9/1/15
If Compliance_Date1 = Todays_Date then
Collection.add “Compliance Date 1”
If Compliance_Date2 = Todays_Date then
Collection.add “Compliance Date 2”
If Compliance_Date3 = Todays_Date then
Collection.add “Compliance Date 3”
Output Entire Collection: Compliance Date 1 Compliance Date 2 Compliance Date 3发布于 2015-08-24 19:38:14
如果您不知道如何使用集合,您可能希望保留一个字符串。
Dim strDateList as string
If Compliance_Date1 = Todays_Date then
strDateList = strDateList & “Compliance Date 1” & vbCrLf
If Compliance_Date2 = Todays_Date then
strDateList = strDateList & “Compliance Date 2” & vbCrLf
If Compliance_Date3 = Todays_Date then
strDateList = strDateList & “Compliance Date 3” & vbCrLf然后“输出它们”
msgbox strDateListhttps://stackoverflow.com/questions/32190252
复制相似问题