vba Excel - 将格式从一个图表系列复制到另一个

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/20495949/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-12 00:53:39  来源:igfitidea点击:

Excel - Copy format from one chart series to another

excelvbacharts

提问by sancho.s ReinstateMonicaCellio

I want to be able to copy all formatting from only one chart series to another. One way of doing this is via VBA, traversing all format properties in the source series and setting the target series accordingly.

我希望能够将所有格式从一个图表系列复制到另一个图表系列。一种方法是通过 VBA,遍历源系列中的所有格式属性并相应地设置目标系列。

Is there any other alternative? (copy and paste-special-formats would copy all chart format, so I guess it is not useful).

还有其他选择吗?(复制和粘贴特殊格式会复制所有图表格式,所以我想它没有用)。

PS: using VBA has a few downsides:

PS:使用 VBA 有一些缺点:

  1. It is quite cumbersome to code this.
  2. It may not be transferable from one Excel version to another (this applies to many other pieces of code, anyway).
  3. Some properties, or combinations thereof, can not be set with VBA.
  1. 对此进行编码非常麻烦。
  2. 它可能无法从一个 Excel 版本转移到另一个版本(无论如何,这适用于许多其他代码段)。
  3. 某些属性或其组合无法使用 VBA 设置。

I have actually coded something, but it is limited since it copies only parts of the format, and it is bound by item 3.

我实际上已经编码了一些东西,但它是有限的,因为它只复制了部分格式,并且它受第 3 项的约束。

回答by sancho.s ReinstateMonicaCellio

Format the first series, select each successively and press F4 for each, per:

格式化第一个系列,依次选择每个并按 F4 为每个,每个:

http://www.pcreview.co.uk/forums/quickly-format-multiple-data-series-one-chart-t3536724.html

http://www.pcreview.co.uk/forums/quickly-format-multiple-data-series-one-chart-t3536724.html