Skip to content

Instantly share code, notes, and snippets.

@ateneva
Last active April 16, 2017 15:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ateneva/7c9eccee655364ccc77be322ba52e82a to your computer and use it in GitHub Desktop.
Save ateneva/7c9eccee655364ccc77be322ba52e82a to your computer and use it in GitHub Desktop.
Insert spaces between uppercase characters
Sub InsertSpacesBetweenCharactersCase()
Dim mStr As String
Dim i As Integer
Dim Cell As Range
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'written by Angelina Teneva, March 2017
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
For Each Cell In ActiveSheet.Range("G3:G43")
mStr = Cell.Value
For i = 1 To Len(mStr)
Select Case Asc(Mid(mStr, i, 1))
Case 65 To 90: Cell.Value = Left(mStr, i - 1) & Chr(32)
End Select
Next i
Next Cell
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment