Excel高-级应用VBA实验题目解析.doc

  1. 1、本文档共17页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
Excel高-级应用VBA实验题目解析

Esy02选定sheet1工作表,合并A1:C1单元格,并输入“TEST”,背景颜色设置为浅黄色,字体颜色设置为红色,字体大小设置为10磅。Sub Macro1() Macro1 Macro 宏由 xu 录制,时间: 2013/3/26 Application.Left = 201.25 Application.Top = 61.75 Range(A1:C1).Select With Selection .HorizontalAlignment = xlCenter .VerticalAlignment = xlBottom .WrapText = False .Orientation = 0 .AddIndent = False .IndentLevel = 0 .ShrinkToFit = False .ReadingOrder = xlContext .MergeCells = False End With Selection.Merge Range(A1:C1).SelectActiveCell.FormulaR1C1 = TESTRange(A1:C1).Select With Selection .HorizontalAlignment = xlCenter .VerticalAlignment = xlCenter .WrapText = False .Orientation = 0 .AddIndent = False .IndentLevel = 0 .ShrinkToFit = False .ReadingOrder = xlContext .MergeCells = True End With With Selection.Font .Name = 宋体 .FontStyle = 常规 .Size = 10 .Strikethrough = False .Superscript = False .Subscript = False .OutlineFont = False .Shadow = False .Underline = xlUnderlineStyleNone .ColorIndex = 3 End With With Selection.Interior .ColorIndex = 6 .Pattern = xlSolid .PatternColorIndex = xlAutomatic End WithEnd Sub2在sheet1上创建“窗体”命令按钮并指定“宏”代码sy22,补充代码完成:从键盘输入一个整数n,输出如下图形。其中每个“*”在单元格中水平和垂直方向都要求居中。nnSub sy22() Dim n As Integer, i As Integer, j As Integer 第1空 n = InputBox(输入行数) 从键盘输入数据并存放到变量n Sheets(Sheet1).Cells.ClearContents 清除sheet1工作表中单元格的内容 For i = 1 To n 循环打印,输出n行* For j = 1 To 2 * i - 1 每行输出奇数(2*i-1)个*,如:1,3,5个 Cells(i, n - i + j).Value = * Next j Next i Cells(1, n).Activate 激活A列N行的单元格 ActiveCell.CurrentRegion.Select 选定单元格所在的当前区域 With Selection .Font.Size = 16 字体大小 .Font.Bold = True 字体加粗 .HorizontalAlignment = xlCenter 水平方向居中 .Ve

文档评论(0)

xxj1658888 + 关注
实名认证
内容提供者

教师资格证持证人

该用户很懒,什么也没介绍

领域认证该用户于2024年04月12日上传了教师资格证

1亿VIP精品文档

相关文档