This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
2
[ACCESS] Need help building a LIX counter in VBA
Author Summary
Sugahdaddy is
in
ACCESS
Post Body
I could really use some help creating a LIX-counter in vba. It's basically a program that reads a text, and then tell you how many words there are, how many sentences and how many words that are long(more than six characters). I've already got the first two down, and i just need help with the last one. If anyone could be so kind as to help me with that (counting the long words) I would be forever grateful. Here is my code so far :
Option Compare Database Option Explicit
Private Sub Command0_Click()
Dim sWords() As String
Dim i As Integer, j As Integer
Dim numsentence As Integer
Dim NumChars As String
Dim moreThanSix
If IsNull(txtInput) Then
MsgBox ("enter text in the left textbox for analyzing.")
Exit Sub
End If
sWords = Split(txtInput, " ")
numsentence = 0
If Len(txtInput) = 0 Then
Exit Sub
Else
numsentence = 1
End If
For i = 1 To Len(txtInput)
If Mid(txtInput, i, 2) = ". " Or Mid(txtInput, i, 2) = "! " Or Mid(txtInput, i, 2) = "? " Or _
Mid(txtInput, i, 2) = "." & Chr(13) Or Mid(txtInput, i, 2) = "!" & Chr(13) Or Mid(txtInput, i, 2) = "?" & Chr(13) Then
numsentence = numsentence 1
End If
Next
txtOutput = "number of words are(M): " & UBound(sWords) 1 & vbNewLine & "Number of sentences is(O): " & numsentence & vbNewLine & _
"words with more than six chars(L): " & NumChars
End Sub
Author
Account Strength
90%
Account Age
11 years
Verified Email
Yes
Verified Flair
No
Total Karma
4,219
Link Karma
49
Comment Karma
4,115
Profile updated: 4 days ago
Posts updated: 1 year ago
Subreddit
Post Details
Location
We try to extract some basic information from the post title. This is not
always successful or accurate, please use your best judgement and compare
these values to the post title and body for confirmation.
- Posted
- 11 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/vba/comment...