香港新浪網 MySinaBlog
« 上一篇 | 下一篇 »
Emily | 20th Oct 2006, 18:03 PM | General | (1008 Reads)

趣味性的 Bug: Characters.Count

Sub CharCounts()
    
    Dim i As Long
    
    With ActiveCell
        Debug.Print .Characters.Text, .Characters.Count
        
        For i = 1 To .Characters.Count
            Debug.Print .Characters(i, 1).Caption, .Characters(i, 1).Count
        Next i
    End With
    
End Sub


 

 Picture

從邏輯上講,Characters(i1) 只返回了ActiveCell i 個字元

原文: http://www.dailydoseofexcel.com/archives/2006/10/18/characters-count