excel - 工作日的 split 函数产生 1 或 0
问题描述
我有一个简单的电子表格,其中包含会议名称、组织者、星期几、开始时间和公司会议的长度。我正在使用拆分函数将星期几放入数组中。我确定 c 列是日期列表的正确列。但我无法弄清楚为什么拆分功能无法正常工作。我将把类对象的代码放在底部。一如既往,任何帮助将不胜感激。代码如下。
Sub ExportToPPT()
'creates a new object for each BRE day/time combination
count = 0
For Each i In BREitems
BREdaysString = Split(Cells(i.Row, "c").value, ",") 'This is where the split happens
For j = 1 To UBound(BREdaysString)
count = count + 1
ReDim Preserve BREobjects(count)
Set BREobjects(count) = New BREpptObjects
With BREobjects(count)
.BREname = Cells(i.Row, "a").value
.BREcategory = Cells(i.Row, "b").value
.BREdays = BREdaysString(j) 'this is where the day is assigned to the object's property. This is a 1 or 0 currently. IDK why.
.BREstartTime = Cells(i.Row, "d").value
.BRElength = Cells(i.Row, "e").value
.BREtimeRight = Right(Cells(i.Row, "d").value, 2)
End With
Next j
Erase BREdaysString
Next i
for i = 1 to UBound(BREobjects)
debug.print BREObjects(i).BREID
next i
.
.
.
'more code that does stuff....
解决方案
推荐阅读
- amazon-web-services - 使用 AWS-Pinpoint 将通知推送到多个设备
- google-translate - 从@google-cloud/translate 得到非常慢的响应
- spring-boot - 如何将自定义弹簧方面注释传递给建议
- html - 如何传递数组代替指向函数的指针
- kubernetes-ingress - 在 aks 中从入口控制器公开多个 tcp 端口
- ruby - Xcode 12、Mac OS 10.15、用于安装 cocoapods 的 Xcode 服务器预集成脚本
- docker - 等待容器的 Docker 错误:上下文已取消
- android - 当列表包含多个 sku productId 时 params.setSkusList(list) 不起作用
- php - PHP JSON API - 检测返回值的数据类型
- sed - sed:如何用文件内容替换单个单词