Table of Contents
To remove the first character from a string in VBA, one can use the built-in function “Mid” and specify the starting position as 2 to exclude the first character. This will return a new string without the first character. Alternatively, the “Right” function can also be used by specifying the number of characters to extract as the length of the string minus 1. Both methods will effectively remove the first character from the original string in VBA.
VBA: Remove First Character from String
You can use the following basic syntax to remove the first character from a string using VBA:
Sub RemoveFirstChar()
Dim i As Integer
Dim myString As String
For i = 2 To 11
myString = Range("A" & i)
Range("B" & i) = Right(myString, Len(myString) - 1)
Next i
End Sub
This particular example removes the first character from each string in the range A2:A11 and outputs the results in the range B2:B11.
The following example shows how to use this syntax in practice.
Example: Using VBA to Remove First Character from Strings
Suppose we have the following list of basketball team names in Excel:

Suppose we would like to remove the first character from each team name.
We can create the following macro to do so:
Sub RemoveFirstChar()
Dim i As Integer
Dim myString As String
For i = 2 To 11
myString = Range("A" & i)
Range("B" & i) = Right(myString, Len(myString) - 1)
Next i
End SubWhen we run this macro, we receive the following output:

Column B displays each of the strings in column A with the first character removed.
If you would instead like to remove the first n characters from a string, simply change the 1 in the Right method to a different number.
For example, we can create the following macro to remove the first 2 characters from a string:
Sub RemoveFirstTwoChar()
Dim i As Integer
Dim myString As String
For i = 2 To 11
myString = Range("A" & i)
Range("B" & i) = Left(myString, Len(myString) - 2)
Next i
End Sub
Column B displays each of the strings in column A with the first two characters removed.
Note: You can find the complete documentation for the VBA Right method .
The following tutorials explain how to perform other common tasks using VBA:
Cite this article
stats writer (2024). How can I remove the first character from a string in VBA?. PSYCHOLOGICAL SCALES. Retrieved from https://scales.arabpsychology.com/stats/how-can-i-remove-the-first-character-from-a-string-in-vba/
stats writer. "How can I remove the first character from a string in VBA?." PSYCHOLOGICAL SCALES, 24 Jun. 2024, https://scales.arabpsychology.com/stats/how-can-i-remove-the-first-character-from-a-string-in-vba/.
stats writer. "How can I remove the first character from a string in VBA?." PSYCHOLOGICAL SCALES, 2024. https://scales.arabpsychology.com/stats/how-can-i-remove-the-first-character-from-a-string-in-vba/.
stats writer (2024) 'How can I remove the first character from a string in VBA?', PSYCHOLOGICAL SCALES. Available at: https://scales.arabpsychology.com/stats/how-can-i-remove-the-first-character-from-a-string-in-vba/.
[1] stats writer, "How can I remove the first character from a string in VBA?," PSYCHOLOGICAL SCALES, vol. X, no. Y, ص Z-Z, June, 2024.
stats writer. How can I remove the first character from a string in VBA?. PSYCHOLOGICAL SCALES. 2024;vol(issue):pages.
