![]() |
Excel macro - truncate cell at X characters (left to right)
Need to create a macro to be able to truncate the contents of cells at X
characters. X will always be the same value. X will be counted left to right Ex. If X = 5 ABC1234 would be truncated to ABC12 |
Excel macro - truncate cell at X characters (left to right)
sub ABC() Dim x as Long, cell as Range x = 5 for each cell in selection cell.Value = left(cell.Value,x) Next end sub -- Regards, Tom Ogilvy "E2goJJM" wrote: Need to create a macro to be able to truncate the contents of cells at X characters. X will always be the same value. X will be counted left to right Ex. If X = 5 ABC1234 would be truncated to ABC12 |
All times are GMT +1. The time now is 10:04 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com