VBA – LTrim String
The LTrim function in VBA is used to remove all leading spaces (spaces at the beginning) from a string
LTrim
Syntax:
LTrim(string)
Parameter:
Return Value:
Example
Dim str1 As String Dim trimmedStr As String str1 = " Hello, World!" trimmedStr = LTrim(str1) ' trimmedStr will be "Hello, World!"
Use Cases:
Key Considerations:
Trim