View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
pk pk is offline
external usenet poster
 
Posts: 27
Default How to write vba to check the last digit of hong kong ID card number

Write the following as one line:

xLastValue = Mid(ActiveCell.FormulaR1C1,
Len(ActiveCell.FormulaR1C1) - 1, 1)

This should do it for you, but it assumes that all card
numbers are formatted the same way. That is, that the
number you want is always the next to the last character
in the string.

Hope this helps...

-----Original Message-----
I am an new learner to write execel vba.

Now, I come across a question about how to write vba so

as to check
the last digit of hong kong id card number, says B583418

(5), how do
you know the last number is 5, and how do you write this

excel vba to
expedite you working.

If anyone know how to write it, please let me have the

solution.

Thanks a lot !!
14/10/03
.