Be the first user to complete this post
|
Add to List |
VBA-Excel: String Functions – Trim()
Description:
The Trim function removes spaces on the left and right side of a string.
Format:
Trim (strMainString)
Arguments:
- strMainString
- Mandatory
- Type: String
- String whose both side spaces needs to be trimmed.
Function FnTrim() Dim strMainString strMainString = " Sumit Jain " MsgBox "Hello" & Trim(strMainString) & "Trimmed both sides." End Function
Also Read About Other String() Functions
INSTR() | InstrREV() | LCase()
Also Read:
- VBA Excel - Cells, Ranges and Offset: Refer Range by using A1 Notations
- VBA Excel - Cells, Ranges and Offset: Refer to Cells by Using Shortcut Notation
- VBA-Excel: Date-Time Functions – DateDiff()
- VBA-Excel: Arrays – Two Dimensional, Static Array
- VBA-Excel: Date-Time Functions – TimeSerial() and TimeValue()