Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
formula to truncate text characters | Excel Discussion (Misc queries) | |||
Trying to truncate or separate the first 3 characters/digits of co | Excel Discussion (Misc queries) | |||
fill or truncate to a certain number of characters in a cell | Excel Worksheet Functions | |||
linking cells in Excel 2003. How to not truncate to 255 characters. | Excel Discussion (Misc queries) | |||
Truncate last five characters | Excel Programming |