使用SparkLines处理迷你图组的属性

上传人:平*** 文档编号:11926297 上传时间:2017-10-15 格式:DOCX 页数:4 大小:27.07KB
返回 下载 相关 举报
使用SparkLines处理迷你图组的属性_第1页
第1页 / 共4页
使用SparkLines处理迷你图组的属性_第2页
第2页 / 共4页
使用SparkLines处理迷你图组的属性_第3页
第3页 / 共4页
使用SparkLines处理迷你图组的属性_第4页
第4页 / 共4页
亲,该文档总共4页,全部预览完了,如果喜欢就下载吧!
资源描述

《使用SparkLines处理迷你图组的属性》由会员分享,可在线阅读,更多相关《使用SparkLines处理迷你图组的属性(4页珍藏版)》请在金锄头文库上搜索。

1、 e800,国内最具活力的 IT 门户网站。http:/【e800 编译】此示例演示在 Microsoft Excel 2010 工作簿中如何使用迷你图组的各项属性。此代码段是 Office 2010 的 101 项 VBA 代码示例中的一部分。与其它示例一样,这些将可以直接写入您的代码中。每块示例代码包含约 5 至 50 行的代码,分别演示了一个独特的功能或功能集,在 VBA或 VB 以及 C中(在 Visual Studio 2010 中创建) 。每个示例之中都会包含代码以及相应注释,这样您就可以直接运行获取预期的结果,或者是根据代码注释提示来调整环境,运行示例代码。Microsoft O

2、ffice 2010 提供了你所需要的工具来创建功能强大的应用程序。Microsoft Visual Basic Application(VBA)代码示例可以帮助你创建自己的应用程序,以执行特定功能或者以此为出发点实现更为复杂的功能。实例代码在 Excel 2010 中新建工作簿,并将代码复制到 Sheet1 类模块。将光标放在WorkWithSparklines,按 F8 开始调试,然后 Shift+ F8 单步执行。并列放置 VBA 和 Excel 窗口,这样你就可以边运行边查看结果。Sub WorkWithSparklines() Make sure you press Shift+F8

3、 to step over this procedure.FillRandomDataDim rng As RangeSet rng = Range(C2, N11) Add sparklines to the second columnDim slg As SparklineGroupDim slRng As RangeSet slRng = Range(B2, B11)Set slg = slRng.SparklineGroups.Add(XlSparkType.xlSparkLine, rng.Address)slg.Points.Highpoint.Visible = True Set

4、tings for the series:With slg.SeriesColor.ThemeColor = 5 e800,国内最具活力的 IT 门户网站。http:/.TintAndShade = 0End With Marker settings:With slg.Points.Markers.Visible = TrueWith .Color.ThemeColor = 6.TintAndShade = 0.5End WithEnd With High point settings:With slg.Points.Highpoint.Visible = TrueWith .Color.Th

5、emeColor = 7.TintAndShade = 0.5End WithEnd With Low point settings:With slg.Points.Lowpoint.Visible = TrueWith .Color.ThemeColor = 2 e800,国内最具活力的 IT 门户网站。http:/.TintAndShade = 0.5End WithEnd With Now change the spark line type:slg.Type = xlSparkColumnEnd SubFunction FillRandomData() As Range No need

6、 to stop through this procedure.Dim month As IntegerFor month = 1 To 12Cells(1, month + 2).Value = MonthName(month, True)Next month Fill in rows with random data.Dim i As IntegerDim j As IntegerFor i = 1 To 10Cells(i + 1, 1).Value = Sales & iFor j = 1 To 12Cells(i + 1, j + 2) = Round(Rnd * 100)Next jNext iRange(C1).CurrentRegion.HorizontalAlignment = xlCenterRange(B:B).ColumnWidth = 15 e800,国内最具活力的 IT 门户网站。http:/End Function

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 行业资料 > 其它行业文档

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号