View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
stefan via OfficeKB.com stefan via OfficeKB.com is offline
external usenet poster
 
Posts: 18
Default ccard 6 or 16 digits


Hi,
I have cell 'C25' or range CCard in which the user may enter the first 2 and
lst 4 digits of a credit card or a full 16 digit card number.
Apparently it seems to be the best way to avoid excels "15-digit rule" to to
a macro in a worksheet change module.
What i'd like to accomplish is that if the user inputs the 2/4 numbers the
result is 54xx xxxx xxxx 3210 and if the user inputs the full number 16
digits it results in 5411 1111 1111 3210. I cant figure out how i can
incorporate this in my existing worksheet change event which is at the end of
this post.
Thank you for your help.

Stefan

Private Sub Worksheet_Change(ByVal Target As Range)
On Error Resume Next
If bDisableEvents Then Exit Sub
If Intersect(Target, Me.Range("C28:H28")) Is Nothing Then Exit Sub
If Target = "" Then Exit Sub
bDisableEvents = True
With Me
.Range("28:28").Insert
.Range("29:29").Copy Range("28:28")
.Range("28:28").ClearContents
.Range("D29").Select
End With
bDisableEvents = False
End Sub


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200507/1