![]() |
Text to columns
I have a column and all I need is the last 5 characters in this field.
Problem is that this field has various text lengths. How can I get the last 5 characters and delete the rest. My spreadsheet has 1,000 or so lines. This Column looks like this: AESGROUPGR123 AESGROUPGR457 AESGROUPGR236 SECTIOGR046 MSGTYHSYHSYHGR123 MSGTYHSYYHGR123 My first thought was to make ths column flush right in Text to columns, but I do not see that making it flush right is an option. Ideas? Thanks. |
Text to columns
Maybe you could use a helper column and use this formula
Change A1 what you need and the 5 is for the first 5 characters from the right. =RIGHT(A1,5) "Allan Fischler" wrote: I have a column and all I need is the last 5 characters in this field. Problem is that this field has various text lengths. How can I get the last 5 characters and delete the rest. My spreadsheet has 1,000 or so lines. This Column looks like this: AESGROUPGR123 AESGROUPGR457 AESGROUPGR236 SECTIOGR046 MSGTYHSYHSYHGR123 MSGTYHSYYHGR123 My first thought was to make ths column flush right in Text to columns, but I do not see that making it flush right is an option. Ideas? Thanks. |
Text to columns
On Oct 8, 8:21 pm, Allan Fischler wrote:
I have a column and all I need is the last 5 characters in this field. Problem is that this field has various text lengths. How can I get the last 5 characters and delete the rest. My spreadsheet has 1,000 or so lines. This Column looks like this: AESGROUPGR123 AESGROUPGR457 AESGROUPGR236 SECTIOGR046 MSGTYHSYHSYHGR123 MSGTYHSYYHGR123 My first thought was to make ths column flush right in Text to columns, but I do not see that making it flush right is an option. Ideas? Thanks. Can you just use a right formula? =RIGHT(A2,5) |
Text to columns
You could use VBA code to get the results your looking for
AESGROUPGR123 will be GR123 AESGROUPGR457 will be GR457 Sub fivecharacters() lastcell = Cells(Rows.Count, "A").End(xlUp).Row For i = 1 To lastcell Range("A" & i).Value = Right(Range("A" & i).Value, 5) Next End Sub "Allan Fischler" wrote: I have a column and all I need is the last 5 characters in this field. Problem is that this field has various text lengths. How can I get the last 5 characters and delete the rest. My spreadsheet has 1,000 or so lines. This Column looks like this: AESGROUPGR123 AESGROUPGR457 AESGROUPGR236 SECTIOGR046 MSGTYHSYHSYHGR123 MSGTYHSYYHGR123 My first thought was to make ths column flush right in Text to columns, but I do not see that making it flush right is an option. Ideas? Thanks. |
All times are GMT +1. The time now is 01:50 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com