excel - 如何在 VBA 中从一种类型的 xlColumnStacked 更改为另一种类型的 xlColumnStacked?
问题描述
我正在尝试运行一个需要布局的图表,该布局不是 Excel 的主要布局。显然,即使布局完全不同,它们也具有相同的图表类型。
Public nome_grafico As String
Public nome_planilha_grafico As String
Public numeroTermicas As Integer
Sub cria_grafico()
Dim graf_ativo As String
nome_planilha_grafico = ActiveSheet.Name
numeroTermicas = Worksheets(nome_planilha_grafico).Cells(1, 6).Value
Worksheets(nome_planilha_grafico).Range(Cells(2, 1), Cells(numeroTermicas + 1, 2)).Select
ActiveSheet.Shapes.AddChart2(297, xlColumnStacked).Select
ActiveChart.SetSourceData Source:=Worksheets(nome_planilha_grafico).Range(Cells(2, 1), Cells(numeroTermicas + 1, 2))
ActiveChart.ChartType = xlColumnStacked
graf_ativo = ActiveChart.Name
nome_grafico = Right(graf_ativo, (Len(graf_ativo) - (Len(nome_planilha_grafico) + 1)))
End Sub
解决方案
推荐阅读
- c - 用C中的计时器计算时间
- cassandra - 无法登录谷歌云平台托管的 3 个节点的 Cassandra 集群中的 cqlsh
- angular - *ngFor 中的变量需要初始化还是非空?
- r - geom_label_repel 在动画中没有正确出现
- android - Android (Oreo+) - 带有 ClickableSpan 的 setJustificationMode
- python - 如何删除列表字典的值
- r - 如何使用投影从 R 中的 st_distance (sp 包)获得正确的距离(以米为单位)?
- ios - 如何修改现有函数以将数据返回到变量
- c++ - 迭代对向量并访问第一个和第二个元素
- android - 如何在对话框中输入 Intent 命令?