arrays - 绘图宏输出数组
问题描述
我正在尝试使用以下代码绘制来自各种工作表的多个单元格列表的输出:
Option Explicit
Function MergeRanges(ParamArray arguments() As Variant) As Variant()
Dim cell As Range, temp() As Variant, argument As Variant
Dim iRows As Integer, i As Integer
ReDim temp(0)
For Each argument In arguments
For Each cell In argument
If cell <> "" Then
temp(UBound(temp)) = cell
ReDim Preserve temp(UBound(temp) + 1)
End If
Next cell
Next argument
ReDim Preserve temp(UBound(temp) - 1)
iRows = Range(Application.Caller.Address).Rows.Count
For i = UBound(temp) To iRows
ReDim Preserve temp(UBound(temp) + 1)
temp(UBound(temp)) = ""
Next i
MergeRanges = Application.Transpose(temp)
End Function
出于某种原因,当我尝试绘制组合来自其他工作表的单元格的数组时,图表不会在 X 轴上产生正确的值 - 它没有正确读取数组。例如,当我从下表(即上述代码的输出)绘制累积 P/L 与日期时,XY 散点图错误地绘制了日期轴:
只是想知道是否有人对这里可能出现的问题有任何想法?
解决方案
推荐阅读
- asp.net-core - ASP.net 核心依赖倒置
- c# - 将 List double 数组转换为 List Double
- android - JobScheduler JobService 在没有应用程序的情况下启动
- android - 如何在 pjsip android 中更改编解码器优先级
- php - laravel 社交名流显示 HTTP 错误 403 - 禁止谷歌登录
- bash - 从 awk 调用 shell 非常慢
- hadoop - 如何在 NiFi 中跟踪 HDFS Active Namenode 更改事件?
- elasticsearch - Elasticsearch 查询按单词搜索,然后按日期为每个索引属性排序
- excel - Excel 中引用后的括号
- python - 在正在运行的 python 进程中创建异常