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.



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


What is the syntax of TRIM function?

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 of the given string
Example 3: Removing the spaces (right side of the 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 “)

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

multiple if statements in excel 2010trim in excel 2007excel merge worksheetshow do i unhide cells in excelexcel remove duplicate rowvbe toolsworksheet tab excelexcel string appendproject management timeline excelmacro excel open filevlookup command in excelvba range clearexcel format row based on cell valuehow to unhide rows in excel 2010lookups excelexcel macro input boxhlookup function in excel with exampleremove excel worksheet passwordexcel macro password crackerexcel vba clear contents of rangeword vbaexcel 2010 sumif functionhow to program macros in excelexcel with vba programminghow to write excel macroworkbook excel vbaexcel macro copy sheetexcel vba trickssave excel vbadedupe in excelvba pop up windowexcel delete cellsunprotect worksheet excel 2013combine multiple excel sheets into one sheetexcel line graph templatesexcel vba array of stringsvba combobox propertiesvba custom message boxvlookup easy exampleinterview questions with answers for freshersexcel automatic sortms access sql server connection stringexcel vba tableexcel autofit row heightworksheet or workbookexcel vba message boxproject costing templatefinancial dashboard examples in excelaria charts 2010how to alphabetize columns in excelexcel averageif formulacompound if statement in excelexcel nested if statementsvba code to connect to sql serverdata control language in sql with exampletutorial macro excelexcel vba close fileunprotect sheet excel passwordexcel macro to remove duplicatesconsolidate worksheetsdeleting duplicates in excelexcel vlookup function examplesexcel comparison operatorscreating dynamic charts in excelvba language referenceinteractive charts excelexcel combo box in cellrange vba excelworkbooks vbahow to use excel vlookup functionoffset excel vbaexcel calculate sheet shortcuttimevalue excelexcel vba copy cellppt schedule templateconcatenate functionabout excel macrosusing vba in accessadodb recordset vbaconstruction project management templates excelduplicate excel worksheet