vb 如何实现EXCEL两个单元格合并 10
2个回答
展开全部
Public Sub MergeCells(tRange As Object)
With tRange
.HorizontalAlignment = -4108 '水平居中excel.XlHAlign.xlHAlignCenter
.VerticalAlignment = -4108 '垂直居中Me.ExcelApp.XlHAlign.xlHAlignCenter '.xlHAlignGeneral
.MergeCells = True
'.xlHAlignGeneral 按照单元数值类型显示’
'.xlHAlignCenter 居中
'.xlHalignLeft :居左、xlHalignRight:居右、
End With
End Sub
With tRange
.HorizontalAlignment = -4108 '水平居中excel.XlHAlign.xlHAlignCenter
.VerticalAlignment = -4108 '垂直居中Me.ExcelApp.XlHAlign.xlHAlignCenter '.xlHAlignGeneral
.MergeCells = True
'.xlHAlignGeneral 按照单元数值类型显示’
'.xlHAlignCenter 居中
'.xlHalignLeft :居左、xlHalignRight:居右、
End With
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询