excel - Series.Formula 将字符(例如逗号)更改为分号
问题描述
我编写了代码来遍历数据(如下所示)并根据类别收集数据。这些数据将被添加到专用数据系列中并绘制在 ScatterPlot 上。
Series.Formula
更改一些字符,例如逗号、分号(下图)并弹出错误。
Dim mySeries As Series
For Each mySeries In ActiveSheet.ChartObjects("Test").Chart.SeriesCollection
For Each c In Source.Range("U7:U13")
If c = mySeries.Name Then
k = 0
Do While Cells(c.row, c.Column) = Cells(c.row + k, c.Column)
k = k + 1
Loop
k = k - 1
srsX = "{"
srsY = "{"
For j = c.row To c.row + k
srsX = srsX & (Cells(j, c.Column + 2)) & "\" '& Application.International(xlListSeparator)
srsY = srsY & (Cells(j, c.Column + 1)) & "\" '& Application.International(xlListSeparator)
Next j
srsX = Left(srsX, Len(srsX) - 1) & "}"
srsY = Left(srsY, Len(srsY) - 1) & "}"
With ActiveSheet.ChartObjects("Test").Chart.SeriesCollection
trashme = "=SERIES(""" & mySeries.Name & """" & Application.International(xlListSeparator) & srsX & Application.International(xlListSeparator) & srsY & Application.International(xlListSeparator) & mySeries.PlotColorIndex & ")"
MsgBox trashme
mySeries.Formula = "=SERIES(""" & mySeries.Name & """" & Application.International(xlListSeparator) & srsX & Application.International(xlListSeparator) & srsY & Application.International(xlListSeparator) & mySeries.PlotColorIndex & ")"
End With
End If
Next c
Next mySeries
解决方案
推荐阅读
- python - KATA 问题:方对方保护树
- swift - 可靠地使用 UICollectionView indexPath 访问字典键?
- image - 如何使用 Flutter Stack 将数据写入图像并保留所有屏幕尺寸的填充?
- css - angular6 组件 CSS 文件中的样式不起作用
- r - RDCOMClient 错误 - InterfaceSupportsErrorInfo 在建议修复后仍然存在
- node.js - 无法在 Azure 应用服务上运行 Next.js 应用
- c# - C# - 如何在 OOXML Word 文档中自动调整表格单元格的高度?
- mysql - 我如何在 DUAL 表中使用小于等于或函数之间的函数?
- javascript - 如何消除两个脚本加载处理程序之间的潜在竞争条件
- for-loop - 更新地图中的键,同时迭代该地图