Excel 之 VBA 入门学习代码详解笔记(1)

Excel 之 VBA 入门学习代码详解笔记(1)

1 Application 对象及基础用法

**'1-1 screenUpdating 屏幕更新:将工作表中数据刷新**
Sub TEXT()
	Worksheets(1).Select
	 MsgBox "目前屏幕中显示工作表 Sheet1"
	 Application.ScreenUpdating = True
	Worksheets(2).Select	 MsgBox "显示 Sheet2 了吗?"
	Worksheets(3).Select
	 MsgBox "显示 Sheet3 了吗?"
	Worksheets(2).Select
	 MsgBox "下面与前面执行的程序代码相同,但关闭屏幕更新功能"
	Worksheets(1).Select
	 MsgBox "目前屏幕中显示工作表 Sheet1" & Chr(10) & "关屏屏幕更新功能"
	 Application.ScreenUpdating = False
	Worksheets(2).Select
	 MsgBox "显示 Sheet2 了吗?"
	Worksheets(3).Select
	 MsgBox "显示 Sheet3 了吗?"
	Worksheets(2).Select
	 Application.ScreenUpdating = True
End Sub
**'1-2StatusBar 状态栏:将工作表下方状态栏显示或影藏信息**
Sub testStatusBar()
	 Application.DisplayStatusBar = True '开启状态栏显示
	 '赋值状态栏显示的文本
	 Application.StatusBar = "http://fanjy.blog.excelhome.net"
	  Application.StatusBar = False
End Sub

**'1-3Cursor 光标设置,更改鼠标光标的特性**
Sub ViewCursors()
	 Application.Cursor = xlNorthwestArrow
	 MsgBox "您将使用箭头光标,切换到 Excel 界面查看光标形状"
	 Application.Cursor = xlIBeam
	 MsgBox "您将使用工形光标,切换到 Excel 界面查看光标形状"
	 Application.Cursor = xlWait
	 MsgBox "您将使用等待形光标,切换到 Excel 界面查看光标形状"
	 Application.Cursor = xlDefault
	 MsgBox "您已将光标恢复为缺省状态"
End Sub

**'1-4Excel系统信息查询**
Sub GetSystemInfo()
	 MsgBox "Excel 版本信息为:" & Application.CalculationVersion
	 '
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值