Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
![]()
I need to take a srting of data and break it apart by columns and only 7
characters per column. Is this something that is posible? -- JTEFUN |
#2
![]()
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
![]()
You can change any group of text to columns by using Word's convert text
feature, however, you can only convert to a specific width in Word, not a number of characters. [Table...|Convert...|Text to table...] It might be easier to do your conversion in Excel. You can paste your string of data into a cell and then use the [Data...|Text to columns...] buttons. You would need to specify "Fixed width" rather than "Delimited" then [Next] and physically move the break lines between your columns to points 7, 14, 21, 28, 35, and so on, on the Data preview graph. you can drag extra lines off the scale. This will separate your data every 7 characters even if there are spaces, commas or other characters. Highlight your new columns and you can paste into Word or imbed the excel table into your document. kathy "JTEFUN" wrote: I need to take a srting of data and break it apart by columns and only 7 characters per column. Is this something that is posible? -- JTEFUN |
#3
![]()
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
![]()
Gosh, I don't know why you would want to do this, but I agree with Kathy that
Excel would be an easier environment to do this feat. You can do it inside MS Word by parsing the text with a Do While... Loop and adding in the commas every 7 characters. I would do is something like this: Sub test() Dim ii As Long, xx As String, yy As String, myRange As Range Set aDoc = ActiveDocument Set myRange = aDoc.Range(Start:=aDoc.Paragraphs(1).Range.Start, End:=aDoc.Paragraphs(1).Range.End) myRange.ConvertToTable Separator:=wdSeparateByParagraphs ii = Len(myRange) xx = myRange myRange.Delete Do While ii 0 If ii 7 Then yy = yy & xx ii = 0 Else yy = yy & Left(xx, 7) & ", " ii = ii - 7 xx = Right(xx, ii) End If Loop With Selection .Collapse .InsertBefore yy End With Set myTable = _ Selection.ConvertToTable(Separator:=wdSeparateByCo mmas, _ Format:=wdTableFormatList1) End Sub Good luck... With the above I ended up taking a 229 character paragraph and separating it into skinny little columns, each with 7 lined up characters. Kind of ugly, but it seems to be what you want. 8^) Cheers, Al "JTEFUN" wrote: I need to take a srting of data and break it apart by columns and only 7 characters per column. Is this something that is posible? -- JTEFUN |
Reply |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Styles, formation and the normal template Word 2003 | Microsoft Word Help | |||
I want to stop columns, Add a sentance, add more columns | Microsoft Word Help | |||
I have four columns and want to freely tab between all columns. | Page Layout | |||
"Click columns, st. toolbar" - can't find picture or word columns | Tables | |||
find a font a child can trace over to learn letter formation | Microsoft Word Help |