电脑桌面
添加小米粒文库到电脑桌面
安装后可以在桌面快捷访问

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

Excel高级应用VBA实验题目解析_第1页
1/14
Excel高级应用VBA实验题目解析_第2页
2/14
Excel高级应用VBA实验题目解析_第3页
3/14
Esy02 1、 选定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").Select ActiveCell.FormulaR1C1 = "TEST" Range("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 With End Sub 2 在sheet1 上创建“窗体”命令按钮并指定“宏”代码 sy22,补充代码完成:从键盘输入一个整数 n,输出如下图形。其中每个“*”在单元格中水平和垂直方向都要求居中。 Sub 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 '字体大...

1、当您付费下载文档后,您只拥有了使用权限,并不意味着购买了版权,文档只能用于自身使用,不得用于其他商业用途(如 [转卖]进行直接盈利或[编辑后售卖]进行间接盈利)。
2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。
3、如文档内容存在违规,或者侵犯商业秘密、侵犯著作权等,请点击“违规举报”。

碎片内容

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

确认删除?
VIP
微信客服
  • 扫码咨询
会员Q群
  • 会员专属群点击这里加入QQ群
客服邮箱
回到顶部