excel图表形状怎么设置

时间:2022-10-08 07:15:15 

excel图表形状怎么设置?下面再举一个例子,如下图1所示。

excel图表形状怎么设置

图1

对单元格H3设置数据有效性如下图2所示。

excel图表形状怎么设置

图2

在形状所在的工作表模块中,输入代码:

Private Sub Worksheet_Change(ByVal Target As Range)  On Error GoTo errHandler  Dim sh As Shape  Dim myColor As Long  Dim lAdj As Long  Set sh = Shapes(“Partial Circle 1”)   If Target.Address = “$H$3″ Then    Application.EnableEvents = False    sh.Adjustments.Item(1) = 0     Select Case Target.Value      Case 0: lAdj = 0      Case Else:  lAdj = -(360 – (360 * Target.Value))    End Select     sh.Adjustments.Item(2) = lAdj     ‘修改形状颜色    Select Case Target.Value      Case Is >= 0.85: myColor _        = RGB(169, 208, 142)  ‘绿色      Case Is >= 0.75: myColor _        = RGB(255, 255, 0)  ‘黄色      Case Is >= 0.5: myColor _        = RGB(255, 192, 0) ‘橙色      Case Else: myColor _        = RGB(255, 0, 0) ‘红色    End Select     sh.Fill.ForeColor.RGB = myColor  End If exitHandler:  Application.EnableEvents = True  Exit Sub errHandler:  MsgBox Err.Number & ” ” &Err.Description  GoTo exitHandlerEnd Sub

我们可以添加一小段代码,让这个图动起来,如下图3所示。

excel图表形状怎么设置

图3

标签:excel图表,excel图表形状怎么设置,excel怎么设置,WPS
0
投稿

猜你喜欢

  • word 帮助功能 使用技巧

    2023-05-30 21:09:19
  • win8系统宽带连接提示错误628代码的故障原因及解决方法

    2022-12-05 13:58:12
  • 深陷mac不能自拔,看我是怎样一步步被它征服的

    2022-03-14 08:31:10
  • 怎么修复Win11系统下未检测到HP惠普扫描仪的问题 附多种方法修复教程

    2023-01-22 17:22:21
  • win7系统怎么还原驱动程序

    2022-09-24 10:12:20
  • Win11如何添加输入法?Win11添加输入法的方法

    2023-04-09 13:50:34
  • win7桌面图标有黑框的解决方法

    2023-08-01 23:09:41
  • 让你的win10系统快速启动 快人一步就是叼

    2022-06-08 02:24:12
  • 什么是nfo文件?

    2023-03-24 12:09:41
  • Win7系统防火墙打开后无法远程怎么办?

    2022-06-03 17:50:50
  • mac怎么禁止某个应用联网?苹果mac禁止某个软件联网教程

    2023-08-19 04:03:33
  • PPT如何制作图片双重曝光效果?PPT制作图片双重曝光效果的方法

    2022-07-22 04:11:26
  • 电脑系统开机卡在加载个人设置的解决方法

    2022-07-21 18:26:22
  • 让 PPT 排版更美观的 3 个技巧

    2023-05-22 18:07:44
  • Windows11是免费升级的吗?免费升级Win11教程

    2022-06-13 10:02:23
  • win11图标的盾牌怎么取消? win11去掉盾牌图标的详细教程

    2023-08-20 05:26:55
  • wps表格怎么调整表格大小都一样?

    2023-01-19 18:56:35
  • PPT跑动字母特效怎么做?可爱的跑动字母特效PPT制作教程

    2022-12-16 09:50:53
  • msi微星电脑怎么安装win7系统?

    2023-09-25 23:20:12
  • Win11如何获得新的照片应用程序?Win11获取新的照片应用程序方法

    2022-09-13 09:38:20
  • asp之家 电脑教程 m.aspxhome.com