Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
raj_srini
 
Posts: n/a
Default Credit Card Number


I have a file contain cells having 16 digit credit card number with junk
data in between as well. As an example
3486824861529530=0
77681879192405=0
12);3917692181846980
101)980735609630572
95)6040002796620470=0
^7838705501761190
6114013383107810*/
8421 7777 9057 6370
9330 64 94 7640 6740
7137482677881720
6982488973900610

What I want to do is as follows
1) Remove all spaces in the cells.
2) After removing the spaces, check in the cell for sixteen consecutive
numeric characters which would be the credit card number
3) Populate the credit card number in a separate column.

Will you be able to help?


--
raj_srini
------------------------------------------------------------------------
raj_srini's Profile: http://www.excelforum.com/member.php...o&userid=32588
View this thread: http://www.excelforum.com/showthread...hreadid=549038

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
CLR
 
Posts: n/a
Default Credit Card Number

The Excel Add-in called ASAP Utilities has features that will perform most of
the tasks you need. It's available free at www.asap-utilities.com

Vaya con Dios,
Chuck, CABGx3



"raj_srini" wrote:


I have a file contain cells having 16 digit credit card number with junk
data in between as well. As an example
3486824861529530=0
77681879192405=0
12);3917692181846980
101)980735609630572
95)6040002796620470=0
^7838705501761190
6114013383107810*/
8421 7777 9057 6370
9330 64 94 7640 6740
7137482677881720
6982488973900610

What I want to do is as follows
1) Remove all spaces in the cells.
2) After removing the spaces, check in the cell for sixteen consecutive
numeric characters which would be the credit card number
3) Populate the credit card number in a separate column.

Will you be able to help?


--
raj_srini
------------------------------------------------------------------------
raj_srini's Profile: http://www.excelforum.com/member.php...o&userid=32588
View this thread: http://www.excelforum.com/showthread...hreadid=549038


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ardus Petus
 
Posts: n/a
Default Credit Card Number

The following UDF should meet your needs:
It needs a reference (VBE ToolsReferences) to :
Microsoft VBScrit Regular Expressions 1.0

HTH
--
AP

'-----------------------------------
Function CreditCardNo(ByVal sRef As String) As String
Static re As RegExp
Dim mc As MatchCollection

If re Is Nothing Then
Set re = New RegExp
re.Pattern = "\d{16}"
End If
sRef = Replace(sRef, " ", "")
Set mc = re.Execute(sRef)
If mc.Count < 1 Then
CreditCardNo = CVErr(xlErrValue)
Else
CreditCardNo = mc(0).Value
End If
End Function

"raj_srini" a écrit
dans le message de news:
...

I have a file contain cells having 16 digit credit card number with junk
data in between as well. As an example
3486824861529530=0
77681879192405=0
12);3917692181846980
101)980735609630572
95)6040002796620470=0
^7838705501761190
6114013383107810*/
8421 7777 9057 6370
9330 64 94 7640 6740
7137482677881720
6982488973900610

What I want to do is as follows
1) Remove all spaces in the cells.
2) After removing the spaces, check in the cell for sixteen consecutive
numeric characters which would be the credit card number
3) Populate the credit card number in a separate column.

Will you be able to help?


--
raj_srini
------------------------------------------------------------------------
raj_srini's Profile:
http://www.excelforum.com/member.php...o&userid=32588
View this thread: http://www.excelforum.com/showthread...hreadid=549038



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
Entering a number on any sheet one time only paulrm906 Excel Discussion (Misc queries) 4 April 2nd 06 06:16 AM
vlookup with more than number to be retrieved martelie Excel Worksheet Functions 1 October 8th 05 07:33 AM
How long will it take to pay off my credit card Wayneca Excel Discussion (Misc queries) 3 May 9th 05 08:32 AM
Formula to figure credit card payments Joe Gieder Excel Worksheet Functions 1 March 24th 05 02:56 AM
How do I do a MOD-10 Credit Card check in Excel? Stephanie Excel Worksheet Functions 3 February 17th 05 10:03 AM


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

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

About Us

"It's about Microsoft Excel"