B
bryantd
Unregistered / Unconfirmed
GUEST, unregistred user!
我想选中一个单元格以后,让这个单元格中的文字靠右对齐。
通过录制宏,VBA代码如下:
Range("C4".Select
With Selection
.HorizontalAlignment = xlRight
.VerticalAlignment = xlCenter
.WrapText = True
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Delphi代码如下:
ExcelApp.Selection.HorizontalAlignment:=xlRight;
但是这里报错:类型不匹配。应该如何处理?
通过录制宏,VBA代码如下:
Range("C4".Select
With Selection
.HorizontalAlignment = xlRight
.VerticalAlignment = xlCenter
.WrapText = True
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Delphi代码如下:
ExcelApp.Selection.HorizontalAlignment:=xlRight;
但是这里报错:类型不匹配。应该如何处理?