在Excel 2010上,我在条件格式化之后会遇到一些奇怪的错误:
在:
后:
或类似(取决于......):
没有错误就可以这样:
我或多或少地确定这是由我在VBA中的个人公式引起的Excel错误:
Function NumCol(plage As Range, ch As String) As Long
'Application.Volatile
For Each c In plage
If c.Value = ch Then NumCol = c.Column
Next
End Function
Function NumLig(plage As Range, ch As String) As Long
'Application.Volatile
For Each c In plage
If c.Value = ch Then NumLig = c.Row
Next
End Function
我该怎么做才能纠正这个视觉错误?
答案 0 :(得分:1)
请尝试
c.HorizontalAlignment = xlCenter
c.VerticalAlignment = xlCenter
在每个循环中。