Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9119825
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T05:29:16+00:00 2026-06-17T05:29:16+00:00

Good day! There is a problem: Selected piece of text. In the allocation is

  • 0

Good day!
There is a problem:
Selected piece of text. In the allocation is as follows:
, .
Example: book 100, pencil 20, …
I would like to find the sum of the numbers in the row and write it at the end, that is,
book 100, the handle 20
$ 120
I’m trying to solve this problem, but does not go …
It is unclear, for example, how to access the character in the string.
Did so:

While i <> EndOfText
Char = Mid (AllSelectionText, i, 1)
If Char> = "0" And Char <= "9" Then
...
End If
i = i 1
Wend

But it is not very nice … must have a function like string (i).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T05:29:17+00:00Added an answer on June 17, 2026 at 5:29 am

    How about using regular expressions? You would need to add a reference to Microsoft VBScript Regular Expressions 5.5, and then you could use the following (not tested):

    Function sumOfNumbersInText(text As String) As Long
    
    Dim rgx As New RegExp  'creates a new instance of the Regular Expression object
    Dim matches As MatchCollection
    Dim mtch As Match
    Dim sum As Long
    
    sum = 0
    rgx.Pattern = "\d+"  'pattern for a sequence of digits
    rgx.Global = True    'find all matches within text
    Set matches = rgx.Execute(text) 'get collection of all substrings matching the pattern
    For Each mtch In matches
        sum = sum + CLng(mtch.Value) 'change each substring into a number and add to sum
    Next
    
    sumOfNumbersInText = sum
    
    End Function
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Good day, just a quick question: I would like to bind a table to
Good day, first I would like to tell that I am not proud to
Good day, I would like to know if that's possible using RegExp and if
Good day, not so long ago, working with Django. Encountered the following problem. There
Good day! I would like to have your suggestions with regards to this matter.
Good day! There are a lot of questions how to store tags in DB
Good day, I have like 15 images I need to be buttons. I have
Good day, Does anyone know if there is a way to determine when all
Good day, I am having a little bit of a problem. I want to
Good day code knights, I have a tricky problem that I cannot see a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.