调整窗口大小 [英] Adjust window size
本文介绍了调整窗口大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在调整Excel的窗口大小,以便它显示一定范围的单元格,例如(B2:K20)。
I am trying adjust the Excel's window size, so that it shows certain range of cells, such as (B2:K20).
是下面的代码有像素对于窗口大小,这是因为我不知道如何使用单元格范围。我对VBA战士有强烈的信心!
Yes the below code has pixel for window size, it's because I don't know how to use cell range. I have a strong faith in VBA warriors here!
Sub win()
With ActiveWindow
.WindowState = xlNormal
.Top = 0
.Left = 0
.Height = 400
.Width = 400
.DisplayGridlines = False
.DisplayFormulas = False
.DisplayGridlines = False
.DisplayHeadings = False
End With
Application.ExecuteExcel4Macro "Show.Toolbar(""Ribbon"",False)"
Application.DisplayFormulaBar = False
ActiveWindow.DisplayWorkbookTabs = False
End Sub
推荐答案
一个选项是将窗口缩放到仅显示范围:
One option would be to scale the window to only show that range:
Range("B2:K20").Select
ActiveWindow.Zoom = True
这篇关于调整窗口大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文