lundi 20 avril 2015

Why do I get different results when using len vs vba.len in vba for excel?

When I run the following macro:

Sub try()

Dim num As Integer

num = 123

MsgBox Len(num)

MsgBox VBA.Len(num)

End Sub

The first msgbox displays 2 and the second msgbox displays 3. If I remove the first line, Dim i as integer, both msgboxs display 3. Can anyone explain why? Thank you.

Aucun commentaire:

Enregistrer un commentaire