Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
Solved

# Coutnting the char. & string in text area.?

Posted on 2001-09-14
Medium Priority
159 Views
Hello,

I have to count the strings & char entered by the user in the text area on cliking the button.
Means to say when the button is clicked  a list box shows the tollal count for all characters entered in the text area like A=78 , n=68 , .=90 & so on .
Plz give me the solution to do this.
0
Question by:arzoo
[X]
###### Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

• Help others & share knowledge
• Earn cash & points
• 2

LVL 3

Accepted Solution

Bahnass earned 200 total points
ID: 6484380
dim AllAscii(256)

for I = 1 to len(Text1.text)
AllAscii(asc(mid(AllAscii(I))))=    AllAscii(asc(mid(AllAscii(I))))+1

next

'   then to get that array
for i =1 to 255
?     AllAscii(I),
next
0

LVL 44

Expert Comment

ID: 6484391
along the same line

Function AscVal(strInput As String)
Dim RetVal As String, I as long

For I = 1 To Len(strInput)
RetVal = RetVal & Asc(Mid(strInput, I, 1))
Next I

AscVal = RetVal
End Function

in your code you can use

lngTextValue = AscVal(Textbox1.Text)

:O)Bruintje
0

LVL 1

Expert Comment

ID: 6484392
'Here is the solution
'u can put the cnt any where u want,like list box or text
'box.

Private Sub Command1_Click()

Dim cnt As Integer
Dim i As Integer

For i = 1 To Len(Text1.Text)
cnt = cnt + Asc(Mid(Text1.Text, i, 1))
Next

MsgBox cnt

End Sub
0

LVL 1

Expert Comment

ID: 6484408

arzoo u have bad credentials,be prompt.
I also suggest all who read,check their crdentials so thatu will spare ur precious time for a worthy person
0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
###### Suggested Courses
Course of the Month4 days, 16 hours left to enroll