View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Claus Busch Claus Busch is offline
external usenet poster
 
Posts: 3,872
Default How to put space in between each Character in same cell with formula

Hi,

Am Thu, 8 Dec 2016 03:16:12 -0800 (PST) schrieb Sunil V:

How to put space in between each Character in same cell with formula
For example: ABCDEF which is in A1 Cell should be converted in to A B C D E F need to add Space in between each character in A1 Cell with formula


try it with a macro.
For each cell in column A:

Sub Space()
Dim i As Long, LRow As Long
Dim rngC As Range
Dim myStr As String

With ActiveSheet
LRow = .Cells(.Rows.Count, "A").End(xlUp).Row
For Each rngC In .Range("A1:A" & LRow)
myStr = rngC.Text
For i = 2 To Len(myStr) * 2 - 1 Step 2
myStr = Left(myStr, i - 1) & " " & Mid(myStr, i)
Next
rngC = myStr
Next
End With
End Sub


Regards
Claus B.
--
Windows10
Office 2016