ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Changing a text entry format (https://www.excelbanter.com/excel-programming/307147-changing-text-entry-format.html)

WillRn

Changing a text entry format
 
I am consolidating some rather large databases that are all indexed with a
medical record number in a specific format. The format I am using is a letter
followed by 9 digits, as follows:

A#########

The source of the data I am attempting to incorporate is also indexed with
the medical record number, but in a straight 12 digit format with the last 9
being the same. It is as follows:

############

I need to convert the second format to the first. Basically drop the first 3
digits and add the letter "N" to the front.

Thanks to Tom Ogilvy, I can now compare the data bases and incorporate the
matching records. But first I must convert the numbers to matching formats.

Any help would be greatly appreciated,

WillRn

Otto Moehrbach[_6_]

Changing a text entry format
 
WillRn
One way:
Sub ConvertFormat()
Dim i as range
Dim MyRange as range
Set MyRange = 'Define the range you want to convert
For each i in MyRange
i = "N" & Right(i, 9)
Next i
End Sub

HTH Otto

"WillRn" wrote in message
...
I am consolidating some rather large databases that are all indexed with a
medical record number in a specific format. The format I am using is a

letter
followed by 9 digits, as follows:

A#########

The source of the data I am attempting to incorporate is also indexed with
the medical record number, but in a straight 12 digit format with the last

9
being the same. It is as follows:

############

I need to convert the second format to the first. Basically drop the first

3
digits and add the letter "N" to the front.

Thanks to Tom Ogilvy, I can now compare the data bases and incorporate the
matching records. But first I must convert the numbers to matching

formats.

Any help would be greatly appreciated,

WillRn





All times are GMT +1. The time now is 06:08 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com