打开的Excle如何使用VBA查看当前窗口的宽与高呢?代码如下:
Sub 查看宽度与高度() Dim myWidth As Double Dim myHeigth As Double myWidth = Application.Width myHeigth = Application.Height MsgBox "当前窗口的宽与高 " _ & vbCrLf & "宽为:" & myWidth _ & vbCrLf & "高为:" & myHeigth, vbInformation End Sub
点击“运行程序”后结果显示如下: