Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用 C# 创建和格式化 Excel 电子表格,所以我需要格式化(合并单元格、更改字体等)直到第一页的最后。如何知道 Excel 电子表格中页面的最后一行?
以下代码将为您提供 Excel 工作表中每个水平分页符之前的最后一行编号:
foreach (Excel.HPageBreak pageBreak in worksheet.HPageBreaks) { int row = pageBreak.Location.Row - 1; // ... }