基本信息
源码名称:vsto2010,Office 2007开发
源码大小:1.10KB
文件格式:.txt
开发语言:ASP
更新时间:2014-11-19
友情提示:(无需注册或充值,赞助后即可获取资源下载链接)
嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):813200300
本次赞助数额为: 5 元×
微信扫码支付:5 元
×
请留下您的邮箱,我们将在2小时内将文件发到您的邮箱
源码介绍
' Excel 2010 ' Demonstrate the AddAboveAverage method ' In a new workbook, in the VBA editor, copy this code ' into the Sheet1 class module. Place the cursor ' inside the TestAboveAverage procedure, and press F5 ' to run the procedure. ' This code fills a range with random integers between ' -50 and 50, and then makes items above the average ' bold and red, and items below average appear blue. Sub TestAboveAverage() ' Fill the range with random numbers between ' -50 and 50. Dim rng As Range Set rng = Range("A1", "A20") SetupRandomData rng ' Create a conditional format for values above average. Dim aa As AboveAverage Set aa = rng.FormatConditions.AddAboveAverage aa.AboveBelow = xlAboveAverage aa.Font.Bold = True aa.Font.Color = vbRed ' Create a conditional format for values below average. Dim ba As AboveAverage Set ba = rng.FormatConditions.AddAboveAverage ba.AboveBelow = xlBelowAverage ba.Font.Color = vbBlue End Sub Sub SetupRandomData(rng As Range) rng.Formula = "=RANDBETWEEN(-50, 50)" End Sub