TRIM Function in Excel

Home/Excel Formulas/TRIM Function in Excel

What is the use of TRIM function?

TRIM Function in Excel removes unwanted spaces whether they occur between words or at the beginning or end of a string, except for single spaces between words.

PREMIUM TEMPLATES LIMITED TIME OFFER

ON SALE80% OFF

50+ Project Management Templates Pack
Excel PowerPoint Word

Advanced Project Plan & Portfolio Template
Excel Template

Business Presentations Templates Pack
PowerPoint Slides

20+ Excel Project Management Pack
Excel Templates

20+ PowerPoint Project Management Pack
PowerPoint Templates

10+ MS Word Project Management Pack
Word Templates


TRIMPur

What is the syntax of TRIM function?

TRIM(text)
TRIM Function in Excel syntax

TRIM Function in Excel – Examples

TRIM Function in Excel

In the above examples, you can observe how TRIM function is removing the unwanted spaces:
Example 1: Removing the spaces (between ANALYSIS and TABS) of the given string
Example 2: Removing the spaces (left side of the mongopono.ru) of the given string
Example 3: Removing the spaces (right side of the mongopono.ru) of the given string
Example 4: Removing the spaces (anywhere) of the given string

VBA example on TRIM function

TRIM function is also available in VBA, following is the example code:

Dim sOutout As String
sOutout =Trim(”    Analysis     Tabs “)

LIMITED TIME OFFER
By |January 25th, 2013|Excel Formulas|0 Comments

About the Author:

Excel VBA Developer having around 8 years of experience in using Excel and VBA for automating the daily tasks, reports generation and dashboards preparation. Valli is sharing to helps us automating daily tasks.

Leave A Comment


Related pages


sql written test questions and answersexcel vlookup alternativeexcel saveashow to use concatenate function in excel 2010tcl commands in sql with examplesmaking a checkbox in excelconditional statement in vbhow to change row height in excelexcel 2007 index functionhow do you create a filesystemobjecthow to remove macros from excelexample of worksheet in excelribbon tab in excelexcel cell value to stringfunction in vba excelshow userformhow to remove the duplicates in excelcool excel macro tricksexcel sales dashboardlookup functions in excelforgot password for excel workbookvba form loadadvanced excel 2010 tutorial pdfpastespecial vbaalign charts in excelcombine multiple sheets into one sheet excelvba change row colorexcel vba copy range to another sheetconcatenation in excelactivate a workbookvba exit loopunlock an excel spreadsheetinsert check mark in excel 2007excel vba check if cell is emptyhow to unlock the excel sheet forgot the passwordexcel vba for dummies pdfpivot table excel 2007 tutorialvba callsql in vbavlookup funtionhlookup in ms excelrange activecellproject charter template powerpointshortcut key for excelmacro open excel filelocation of personal xlsbadvanced filter in excel vbavba application.vlookuplearning macros in excelvba excel tutorialshow to write vba code in accessadvanced filter excel unique recordshow to use averageif function in excel 2010vba get file extensionhow to unlock a locked excel filecell shading in excelexcel formula iferrorexcel chart formulams office gantt chart templatecreating a stock chart in excellistbox item selectedddl dml tclvba selectionvlookups tutorialexcel 2010 vba select casedelete duplicate values exceldelete vbavba word userformhow to find duplicate values in excelbubble graphs in excelvba samplessumif excel