Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Friends, I have a column of data in my spreadsheet that has extra spaces after the data in each cell. For example, rather than having "DELL" it has "DELL ". What is the function to get rid of the extra spaces? Thanks, Alan -- achidsey |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Trim() will delete all trailing spaces.
|
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
=Trim(A1)
Where A1 contains the word "Dell " In code it would look like this sheet1.range("A1").value = trim(sheet1.range("A1").value) -- HTH... Jim Thomlinson "achidsey" wrote: Friends, I have a column of data in my spreadsheet that has extra spaces after the data in each cell. For example, rather than having "DELL" it has "DELL ". What is the function to get rid of the extra spaces? Thanks, Alan -- achidsey |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() J and Jim, Thanks for your assistance Alan -- achidsey "achidsey" wrote: Friends, I have a column of data in my spreadsheet that has extra spaces after the data in each cell. For example, rather than having "DELL" it has "DELL ". What is the function to get rid of the extra spaces? Thanks, Alan -- achidsey |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Its probably a trivial point in this case, but there are three types of trim
in VBA: From the help: LTrim, RTrim, and Trim Functions Returns a Variant (String) containing a copy of a specified string without leading spaces (LTrim), trailing spaces (RTrim), or both leading and trailing spaces (Trim). -- regards, Tom Ogilvy "achidsey" (notmorespam) wrote in message ... J and Jim, Thanks for your assistance Alan -- achidsey "achidsey" wrote: Friends, I have a column of data in my spreadsheet that has extra spaces after the data in each cell. For example, rather than having "DELL" it has "DELL ". What is the function to get rid of the extra spaces? Thanks, Alan -- achidsey |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
And just to add to Tom's trivial point, an even more trivial point...
If the OP wants to remove leading, trailing and multiple repeated internal spaces, the OP could use: application.trim() " this is a test " would become "this is a test" (quotes used just for readability.) Tom Ogilvy wrote: Its probably a trivial point in this case, but there are three types of trim in VBA: From the help: LTrim, RTrim, and Trim Functions Returns a Variant (String) containing a copy of a specified string without leading spaces (LTrim), trailing spaces (RTrim), or both leading and trailing spaces (Trim). -- regards, Tom Ogilvy "achidsey" (notmorespam) wrote in message ... J and Jim, Thanks for your assistance Alan -- achidsey "achidsey" wrote: Friends, I have a column of data in my spreadsheet that has extra spaces after the data in each cell. For example, rather than having "DELL" it has "DELL ". What is the function to get rid of the extra spaces? Thanks, Alan -- achidsey -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
merging spreadsheets/one has extra space in each cell | Excel Discussion (Misc queries) | |||
space before cell contents | Excel Worksheet Functions | |||
space before cell contents | Excel Worksheet Functions | |||
How do I delete an extra space in every cell in a column? | Excel Discussion (Misc queries) | |||
If it's not a space, return the cell contents. | Excel Worksheet Functions |