ThinkChat🤖让你学习和工作更高效,注册即送10W Token,即刻开启你的AI之旅 广告
```java //CellRangeAddress(int firstRow, int lastRow, int firstCol, int lastCol) //firstRow - lastRow:将firstRow到lastRow之间的行合并 //firstCol - lastCol:将firstCol到lastCol之间的列合并 //合并前2行前3列 sheet.addMergedRegion(new CellRangeAddress(0,1,0,2)); ``` :-: ![](https://img.kancloud.cn/a2/b3/a2b31dd2960c2098636de4b1fb9038c1_1662x322.png) 合并前 ![](https://img.kancloud.cn/a8/83/a883267175726f5f16325503f4239897_1602x222.png) 合并后