LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
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
 
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 do you change single digits to recognized double digits? Evil with a K[_2_] Excel Worksheet Functions 5 April 3rd 23 02:29 PM
VBA write macro change column with 3 number digits to 4 digits the James C[_2_] Excel Discussion (Misc queries) 3 January 25th 10 03:12 PM
number 12 digits to 15 digits mehdy-e Excel Discussion (Misc queries) 5 November 13th 09 04:43 PM
How to customize number to 10 digits including 2 digits after deci Carina Excel Worksheet Functions 3 September 20th 07 02:50 AM
last ten digits Martina Excel Worksheet Functions 5 December 1st 06 04:53 AM


All times are GMT +1. The time now is 02:38 PM.

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"