VBA Delete Spaces Between numbers and characters within range in Excel. We can use Find and Replace VBA functions to remove spaces completely between characters and numbers.
Let us see the example macro to Remove Spaces within Range in Excel VBA.
'Macro to Remove Spaces Between Numbers and Characters within Range in Excel VBA Sub VBA_Remove_Spaces_Between_Numbers_Characters() 'Variable Declaration Dim rRange As Range Set rRange = ActiveSheet.Range("A1:G200") rRange.Replace What:=Space(1), Replacement:="", _ SearchOrder:=xlByColumns, MatchCase:=True Set rRange = rRange.Find(What:=Space(1)) If Not rRange Is Nothing Then 'Procedure repeats until all spaces are removed Call VBA_Remove_Spaces_Between_Words End If End Sub
output: Here is the output screenshot of above macro code.
You can refer the following link for the step by step instructions.
Click on the following links of the useful resources. These helps to learn and gain more knowledge.