Replacing
There is one built-in function and one built-in statement you can use for replacing strings.
REPLACE(expression, find, replace [,start] [,count] [,compare])
You can use the REPLACE function to return a text string with a number of characters replaced.
This built-in function is case sensitive by default.
If you would prefer the function to not be case sensitive, you can change the default "compare" argument.
vbCompareMethod
MID(stringvar, start [,length]) = string
You can use the MID - Statement to replace a specified number of characters with characters from another string.
Not to be confused with the MID - Function which returns a specified number of characters.
Replacing from the middle
You can use the INSTR function to return the position of a substring within a larger string, starting at the beginning.
You can use the LEFT function to return a number of characters from the left of a string.
You can use the RIGHT function to return a number of characters from the right of a string.
Replacing the first occurrence
You can use the REPLACE function to return a text string with a number of characters replaced.
Replacing the last occurrence
You can use the STRREVERSE function to return the text string with the characters reversed.
Replacing double quotes
You can use the REPLACE function to return a text string with a number of characters replaced.
Replacing line break
You can use the REPLACE function to return a text string with a number of characters replaced.
© 2026 Better Solutions Limited. All Rights Reserved. © 2026 Better Solutions Limited TopPrevNext