excel - 验证是否已经使用 VBA 创建了时间线
问题描述
我的电子表格中有一个timeline
,但我想通过 VBA 代码验证时间线是否存在。
我如何检查是否有一个?
解决方案
时间线是 aSlicerCache
和 a SlicerCacheType
:xlTimeline
Sub FindTheTimeline()
Dim cache As SlicerCache
For Each cache In ThisWorkbook.SlicerCaches
If cache.SlicerCacheType = xlTimeline Then
Debug.Print "Got a timeline!"
Exit Sub
End If
Next
End Sub
推荐阅读
- java - 如何让我的 BFS 算法运行得更快?
- node.js - Fluent FFMPEG 复杂过滤器将文件拆分为多个输出
- pytest - Pytest - 是否可以创建一个过滤另一个夹具的夹具?
- python - 如何获取所需位置的组合列表的特定索引值
- python - matplotlib plt.figsize() 参数不适用于 pandas DataFrame 图
- r - R Shiny DT 行选择和行编辑冲突
- node.js - NGCC 运行 ng serve 时编译失败
- r - tmap/ tmaptools geocode_OSM 函数错误
- linux - 内核中多个缓冲区的 mmap 崩溃请帮助(使用 dma_mmap_coherent)
- python-3.x - 将文件夹 PYTHON 中的多个 pdf 转换为 txt