How to use Rtrim in excel
daniel
-
Mytå Posted messages 4246 Registration date Status Contributor Last intervention -
Mytå Posted messages 4246 Registration date Status Contributor Last intervention -
Hello,
I can't use the Rtrim function in Excel
how do I do it?
thank you for your help
Daniel
Configuration: Windows XP / Firefox 3.6.8
I can't use the Rtrim function in Excel
how do I do it?
thank you for your help
Daniel
Configuration: Windows XP / Firefox 3.6.8
5 answers
-
Hello,
I am a complete novice and so I was simply asking where to enter the proposed terms and hit F1
Thank you -
Hello forum
A little reminder about F1 on Rtrim
This example uses the LTrim and RTrim functions to eliminate spaces on the left and right of a string variable, respectively. The Trim function eliminates both types of spaces.
Dim MyString, TrimString MyString = " <-Trim-> " ' Initializes the string. TrimString = LTrim(MyString) ' TrimString = "<-Trim-> ". TrimString = RTrim(MyString) ' TrimString = <-Trim->". TrimString = LTrim(RTrim(MyString)) ' TrimString = "<-Trim->". ' Using the Trim function alone produces the same result. TrimString = Trim(MyString) ' TrimString = "<-Trim->".
Mytå
Thank you for your question, we are not robots...
Installed versions [MsProject 2003(FR), Excel 2003-2007(FR)] -
Thank you, but I still don't know how to use this function
should it be placed at the top of the list...
thank you -
Hello,
The example of Mytå seems clear to me, your question much less so, could you provide more details on what you would like? -
Re,
Actually, the Rtrim function is not an Excel function; it is a Visual Basic for Applications (VBA) function. VBA is a programming language for applications like Excel, Word...
In Excel, there is no equivalent for Rtrim and Ltrim, but there is an equivalent for the Trim function, which is TRIM().
Since you are a novice, I recommend that you familiarize yourself with using Excel to acquire a basic level of mastery before diving into programming an application whose functioning you do not understand well enough.
As our neighbors say: He who goes slowly, goes safely and goes far.
Sincerely-
-
-
-
Hello forum
Daniel, if the TRIM function isn't working, you might be dealing with non-breaking spaces: that's ALT+0160
Replace the first line of the macro and you'll see the result.
Cells(1, 1) = Chr(160) & " Test Macro Daniel " & Chr(160)
Using REPLACE will allow you to do the job
LTrim(Replace(Cells(1, 1), Chr(160), " "))
Looking forward to hearing from you
Mytå -
-