View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ron Rosenfeld Ron Rosenfeld is offline
external usenet poster
 
Posts: 5,651
Default Manipulating this text.

On Wed, 28 Mar 2007 19:45:45 -0400, "StargateFanFromWork"
wrote:

Here's what's needed after pasting a text string into A1:
1. Remove the spaces between the words.
2. Take that text string and cut it in half into 2 sentences.
3. Re-arrange the 2 "sentences" so that the letters are no longer
horizontal but vertical and, therefore, become vertical sentences in two
columns.
Separate the 2 setences-turned-into-columns by one empty column (width
unimportant at this point, though about 20 pixels great).


This code might do what you describe:

==========================================
Option Explicit

Sub Syll()
Dim c As Range
Dim str As String
Dim i As Long

Set c = Selection

str = c.Text
str = Replace(str, " ", "")

For i = 1 To Int(Len(str) / 2)
c.Offset(i, 0).Value = Mid(str, i, 1)
Next i

For i = i To Len(str)
c.Offset(i - Int(Len(str) / 2), 2).Value = Mid(str, i, 1)
Next i

End Sub
=================================================
--ron