每当我退出我的wb时,我的冻结行重置。可能在附近徘徊?

时间:2015-09-23 22:18:33

标签: excel

我有一个大的垂直表,我每天操作。每次打开工作簿时,我都必须冻结顶层窗格。我使用双显示器,所以我通常有两个窗口打开,如果这很重要。

有没有办法可以永久冻结顶部窗格?

1 个答案:

答案 0 :(得分:0)

哈哈想出来了!

Sub FreezePane()

Dim excApp As Excel.Application
Set excApp = GetObject(, "Excel.Application")

Sheets("Inventory").Activate
excApp.ActiveWorkbook.ActiveSheet.Range("B3").Select
excApp.ActiveWindow.FreezePanes = True

Sheets("Calculations").Activate
excApp.ActiveWorkbook.ActiveSheet.Range("B2").Select
excApp.ActiveWindow.FreezePanes = True

Sheets("WDCap").Activate
excApp.ActiveWorkbook.ActiveSheet.Range("C15").Select
excApp.ActiveWindow.FreezePanes = True

Sheets("InjCap").Activate
excApp.ActiveWorkbook.ActiveSheet.Range("C15").Select
excApp.ActiveWindow.FreezePanes = True

Sheets("Incremental P&L").Activate
excApp.ActiveWorkbook.ActiveSheet.Range("C11").Select
excApp.ActiveWindow.FreezePanes = True

Sheets("Dashboard").Activate

End Sub