Saturday, April 20, 2019

Remove a Character from Selection find replace


Remove a Character from Selection
To remove a particular character from a selected cell you can use this code. It will show you an input box to enter the character you want to remove.

Find and replace
Sub removeChar()
Dim Rng As Range
Dim rc As String
rc = InputBox("Character(s) to Replace", "Enter Value")
For Each Rng In Selection
Selection.Replace What:=rc, Replacement:=""
Next
End Sub

No comments:

Post a Comment