ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Changing data in a column (https://www.excelbanter.com/excel-programming/322092-changing-data-column.html)

jerry chapman[_2_]

Changing data in a column
 
I would like to write a macro to change all the used entries in column A
such that only the right most 5 characters are displayed for each entry.
What would such a macro look like?



Tom Ogilvy

Changing data in a column
 
Sub Right5()
Dim rng as Range, cell as Range
Set rng = columns(1).specialCells(xlConstants)
for each cell in rng
cell.Value = right(cell.Value,5)
Next
End Sub

--
Regards,
Tom Ogilvy


"jerry chapman" wrote in message
...
I would like to write a macro to change all the used entries in column A
such that only the right most 5 characters are displayed for each entry.
What would such a macro look like?






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

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