Module Module1
    Public Sub cal_word(ByVal s As String)
        Dim counter As Integer
        For i = 1 To Len(s)
            If Mid(s, i, 1) <> " " Then
                counter = counter + 1
            End If
        Next
        MsgBox("總字數（不含空格）為" & counter)
    End Sub
End Module
