冻结Excel工作表的最顶部行
Contents
[
Hide
]
介绍
在本文章中,我们将学习如何冻结顶部行。当您在一行下有大量共同标题的数据时,向下滚动工作表时,您无法看到标题。您可以冻结顶部行,以便在其余数据被滚动时仍然可以看到该冻结部分。您可以轻松看到顶部行的标题。
在Excel中冻结行
- 如果您想要冻结顶部行,则首先选择需要冻结的行下方的行
- 单击“查看”>“冻结窗格”
- 在下拉菜单中,单击“冻结顶部行”。
- 如果向下滚动,第一行始终处于顶部视图中。
正如您所看到的,第一行已被冻结,当您向下滚动时,第一行始终保持在视图顶部。
冻结行使您能够查看大量数据,无需跟踪行标签。
使用Aspose.Cells for .Net冻结行
使用Aspose.Cells for .Net很容易冻结行。 请使用Worksheet.FreezePanes方法在所选行处冻结行。 1.构建工作簿以打开文件或创建一个空文件。 2. 使用Worksheet.FreezePanes()方法冻结第一行。 3.保存文件。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Instantiate a new Workbook. | |
Workbook workbook = new Workbook("Freeze.xlsx"); | |
// Freezing panes at th cell B2 | |
workbook.Worksheets[0].FreezePanes("A2", 1, 0); | |
// Saving the file | |
workbook.Save("frozen.xlsx"); |
附有示例源Excel文件。