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.

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

120+ Professional Project Management Templates!
Save Up to 85% LIMITED TIME OFFER

A Powerful & Multi-purpose Templates for project management. Now seamlessly manage your projects, tasks, meetings, presentations, teams, customers, stakeholders and time. This page describes all the amazing new features and options that come with our premium templates.

Browse All Templates
Excel VBA Project Management Templates

All-in-One Pack
120+ Project Management
Premium Templates
View Details

Essential Pack
50+ Project Management
Premium Templates
View Details
50+ Excel
Project Management
Templates Pack
View Details
50+ PowerPoint
Project Management
Templates Pack
View Details
25+ MS Word
Project Management
Templates Pack
View Details
Ultimate Project Management Template
View Details
Ultimate Resource Management Template
View Details
Project Portfolio Management Templates
View Details
By Last Updated: June 17, 2022Categories: Excel FormulasTags:

Share This Story, Choose Your Platform!

Leave A Comment