Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
truncate text using VBA Excel
Hi, I've got a progam running in CL (AS400) that exports a file into a cs file. This file contains names of other files that I wish to open. Th problem being these fiels have a fixed length of 10 and are filled wit blanks if the text is not long enough to fill the 10 characters. This cause a problem when joining field with ".csv". Eg "EEC1 " & ".csv" I get "EEC1 .csv", and I want "EEC1.csv" Is there a way to do this. Thanks Eve Emer ----------------------------------------------- ~~ Message posted from http://www.ExcelTip.com ~~View and post usenet messages directly from http://www.ExcelForum.com |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
truncate text using VBA Excel
You can use the Trim function
Sub test() For Each cell In Columns("A").SpecialCells(xlCellTypeConstants) cell.Value = Trim(cell.Value) Next End Sub -- Regards Ron de Bruin (Win XP Pro SP-1 XL2002 SP-2) www.rondebruin.nl "maehe" wrote in message ... Hi, I've got a progam running in CL (AS400) that exports a file into a csv file. This file contains names of other files that I wish to open. The problem being these fiels have a fixed length of 10 and are filled with blanks if the text is not long enough to fill the 10 characters. This cause a problem when joining field with ".csv". Eg "EEC1 " & ".csv" I get "EEC1 .csv", and I want "EEC1.csv" Is there a way to do this. Thanks Eve Emery ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~View and post usenet messages directly from http://www.ExcelForum.com/ |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
truncate text using VBA Excel
Thank You very much! It's all implemented fine! Thank you again : ----------------------------------------------- ~~ Message posted from http://www.ExcelTip.com ~~View and post usenet messages directly from http://www.ExcelForum.com |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I truncate linked text? | Excel Worksheet Functions | |||
formula to truncate text characters | Excel Discussion (Misc queries) | |||
truncate text to first word | Excel Discussion (Misc queries) | |||
How do I truncate a text field in Excel? | Excel Worksheet Functions | |||
How do you truncate a text string? | Excel Worksheet Functions |