ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How do I shorten a 17 digit field to a 6 digit field? (https://www.excelbanter.com/excel-programming/368549-how-do-i-shorten-17-digit-field-6-digit-field.html)

Paul Bass

How do I shorten a 17 digit field to a 6 digit field?
 
I am using Microsoft Exce 2002. I am trying to shorten a few hundred 17
digit alphanumeric fields to just the last 6 digits of the 17 digit fields.
Any ideas would be helpful.

Miguel Zapico

How do I shorten a 17 digit field to a 6 digit field?
 
One approach can be with the worksheet formula RIGHT. If you have you data
in column A, something like this in column B will do what you want:
=RIGHT(A1,6)

Hope this helps,
Miguel.

"Paul Bass" wrote:

I am using Microsoft Exce 2002. I am trying to shorten a few hundred 17
digit alphanumeric fields to just the last 6 digits of the 17 digit fields.
Any ideas would be helpful.


Don Guillett

How do I shorten a 17 digit field to a 6 digit field?
 
Sub shorten()
For i = 1 To Cells(Rows.Count, "e").End(xlUp).Row
Cells(i, "e").Value = Right(Cells(i, "e"), 6)
Next i
End Sub

--
Don Guillett
SalesAid Software

"Paul Bass" <Paul
wrote in message
...
I am using Microsoft Exce 2002. I am trying to shorten a few hundred 17
digit alphanumeric fields to just the last 6 digits of the 17 digit
fields.
Any ideas would be helpful.





All times are GMT +1. The time now is 06:00 AM.

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