Sub AddSpaces()
With Range("A1", Range("A" & Rows.Count).End(xlUp))
.Offset(, 1).Value = Evaluate(Replace("if(row(#),replace(rept("" "",11),5,0,#),"""")", "#", .Address))
End With
End Sub
Sub AddSpaces()
With Range("A1", Range("A" & Rows.Count).End(xlUp))
.Offset(, 1).Value = Evaluate(Replace("if(row(#),if(#="""","""",replace(rept("" "",11),5,0,#)),"""")", "#", .Address))
End With
End Sub
You could simplify the line of code highlighted in red slightly by doing it this way...Rich (BB code):Sub AddSpaces() With Range("A1", Range("A" & Rows.Count).End(xlUp)) .Offset(, 1).Value = Evaluate(Replace("if(row(#),replace(rept("" "",11),5,0,#),"""")", "#", .Address)) End With End Sub
Sub xAddSpaces()
With Range("A1", Range("A" & Rows.Count).End(xlUp))
.Offset(, 1).Value = Evaluate("if({1},replace(rept("" "",11),5,0," & .Address & "),"""")")
End With
End Sub