Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,872
Default check digit number

Hi Kevin,

Am Tue, 30 Dec 2014 18:21:38 +0000 schrieb Benny123:

The number that I am looking for is:

10098987203140227 and then the check digit.


try it with a function:

Function NewCheck(myRng As Range) As Long
Dim No1 As String
Dim mySum As Long, i As Long

For i = 1 To 17 Step 2
No1 = No1 & Mid(myRng, i, 1)
Next

For i = 2 To 16 Step 2
mySum = mySum + Mid(myRng, i, 1)
Next

No1 = 2 * No1
For i = 1 To Len(No1)
mySum = mySum + Mid(No1, i, 1)
Next

NewCheck = WorksheetFunction.RoundUp(mySum, -1) - mySum
End Function


Regards
Claus B.
--
Vista Ultimate / Windows7
Office 2007 Ultimate / 2010 Professional
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to get excel to check last 2 digits in a 4 digit number realtorpete Excel Discussion (Misc queries) 3 January 4th 09 08:52 PM
How to validate a cell to insert from 9 digit number to 13 digit number. ramulu via OfficeKB.com Excel Worksheet Functions 1 February 21st 07 02:32 PM
How to validate a cell to insert from 9 digit number to 13 digit number. ramulu Excel Worksheet Functions 1 February 21st 07 10:00 AM
When we enter a 16 digit number (credit card) the last digit chan. ceking Excel Discussion (Misc queries) 5 December 8th 04 11:45 PM
How to write vba to check the last digit of hong kong ID card number eric chan Excel Programming 3 October 15th 03 04:15 AM


All times are GMT +1. The time now is 12:49 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"