- Home
- Premium Memberships
- Lottery Results
- Forums
- Predictions
- Lottery Post Videos
- News
- Search Drawings
- Search Lottery Post
- Lottery Systems
- Lottery Charts
- Lottery Wheels
- Worldwide Jackpots
- Quick Picks
- On This Day in History
- Blogs
- Online Games
- Premium Features
- Contact Us
- Whitelist Lottery Post
- Rules
- Lottery Book Store
- Lottery Post Gift Shop
The time is now 7:29 am
You last visited
March 29, 2024, 5:52 am
All times shown are
Eastern Time (GMT-5:00)
Sum of Digits in 1 Cell - VBA Code
Published:
- Alt+F11 to open Visual Basic Editor (VBE).
- From the Insert menu, select Module (to add a module).
- Enter the following lines of code into the module:
Function SumDigits(Number)
Dim i As Integer
For i = 1 To Len(Number)
SumDigits = SumDigits + Val(Mid(Number, i, 1))
Next i
End Function
To test the function:
- To test the function, open Paste Function (Shift+F3).
- From the User Defined category, select the SumDigits function.
- In the function box, select any cell that contains a number.
- Click OK.
- Good for Pick 3 and Pick 4 digit numbers or any size number (I think)
Comments
This Blog entry currently has no comments.
Post a Comment
Please Log In
To use this feature you must be logged into your Lottery Post account.
Not a member yet?
If you don't yet have a Lottery Post account, it's simple and free to create one! Just tap the Register button and after a quick process you'll be part of our lottery community.
Register