Excel精英培训网

 找回密码
 注册
数据透视表40+个常用小技巧,让你一次学会!
查看: 754|回复: 1

[已解决]方法和数据成员未找到

[复制链接]
发表于 2022-7-5 13:53 | 显示全部楼层 |阅读模式
添加趋势图最新日期数据标签
运行代码了错,我的版本是office Excel2007
截图202275134730.png
最佳答案
2022-7-5 21:33

是這樣嗎? 請測試看看,謝謝

Sub test()
Dim xR As Range
If ActiveChart Is Nothing Then MsgBox "選圖表": Exit Sub
Set xR = Application.InputBox(prompt:="選資料範圍", Type:=8)
ActiveChart.SetSourceData Source:=xR
End Sub

自动添加数据标签.zip

22.21 KB, 下载次数: 7

发表于 2022-7-5 21:33 | 显示全部楼层    本楼为最佳答案   

是這樣嗎? 請測試看看,謝謝

Sub test()
Dim xR As Range
If ActiveChart Is Nothing Then MsgBox "選圖表": Exit Sub
Set xR = Application.InputBox(prompt:="選資料範圍", Type:=8)
ActiveChart.SetSourceData Source:=xR
End Sub

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|Excel精英培训 ( 豫ICP备11015029号 )

GMT+8, 2024-4-28 02:07 , Processed in 0.136526 second(s), 10 queries , Gzip On, Yac On.

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表