WeaponX 0 Report post Posted August 14, 2005 I have a huge word document that I want to be able to add a comma to the end of each line and then concatenate the whole document together. For example: test testing 1 test 23 4 I want that to be something like: test,testing 1,test 23 4 I tried doing this using a macro (not very good at), but couldn't get them to come out right. Basically I want to make sure that each line connects to the previous one followed by a comma at the end. My document so far has over 4,300 lines now and growing. Any VBA experts out there or does anyone else know of an easier way to do this? Thanks. Share this post Link to post Share on other sites
calixt 0 Report post Posted August 14, 2005 I have a huge word document that I want to be able to add a comma to the end of each line and then concatenate the whole document together. For example: <{POST_SNAPBACK}> WeaponX,have you tried replacing paragraphs with commas using Edit->Replace? To search for a paragraph mark, write "^p" into the input field (at least, it's like that in my German Word-version). Calixt Share this post Link to post Share on other sites
WeaponX 0 Report post Posted August 14, 2005 Thanks Calixt, I never thought of that before. That will connect all of those lines together? How about the commas? Any easy way to do this? So far, I'm just creating two macros:1. One is to add a comma to the end of a line.2. The second one is basically mimicking what I did with #1 above except I'm running it through a few pages of lines first.Then I save the second macro and run the second macro many times so it gets to the very end. Share this post Link to post Share on other sites
WeaponX 0 Report post Posted August 20, 2005 Is there a program that will allow me to have one HUGE line without any limits? I have thousands of lines of text in a Word document and I used the replacement method for paragraphs and that did part of the work. But I still have a lot of lines leftover. I want them ALL to be in one very lone single line only. Word seems to limit this and I tried using other text editors and they were about the same (still have many lines leftover). Share this post Link to post Share on other sites
calixt 0 Report post Posted September 5, 2005 Is there a program that will allow me to have one HUGE line without any limits? I have thousands of lines of text in a Word document and I used the replacement method for paragraphs and that did part of the work. But I still have a lot of lines leftover. I want them ALL to be in one very lone single line only. Word seems to limit this and I tried using other text editors and they were about the same (still have many lines leftover). WeaponX,I am not sure but the reason for your "leftovers" may be that not every line-break is a "paragraph". I understand that the replacement method works well but covers not all the line-breaks in your documents. Maybe there are some "manual line breaks" in your docs which do not have the field code "^p" but "^l". Share this post Link to post Share on other sites
iGuest 3 Report post Posted June 1, 2009 search for ^p and replace it with blank space and comma. For manual line breaks, replace ^l with blank space and comma-reply by Ankit Jain Share this post Link to post Share on other sites
iGuest 3 Report post Posted July 10, 2009 Great!! The ^p replacement worked perfectly on my english version Word. Thank you!! Share this post Link to post Share on other sites
iGuest 3 Report post Posted December 15, 2009 Appending Text to existing text in a text boxAdding Comma To End Of Line & Concatenating LinesI have built a telephone key pad using the drawing function of Excel. Each button is a "Shapes("Group xxx")" and I have assigned a macro to each button so that when I click on each button the number shows up in a text box. My problem is that when I touch successive buttons the previous number in the text box is over written. How can I change the code (listed below) so that successive button clicks append numbers to the text box so I can see the entire telephone number I dialed? The code for button #1 and #2 is as follows: Sub Group644_Click()'' Button #1 Macro' Macro recorded 12/12/2009 by bg'' ActiveSheet.Shapes("Group 644").Select ActiveSheet.Shapes("TextBox 656").Select Selection.Characters.Text = "1" With Selection.Characters(Start:=1, Length:=20).Font .Name = "Tahoma" .FontStyle = "Regular" .Size = 16 .Strikethrough = False .Superscript = False .Subscript = False .OutlineFont = False .Shadow = False .Underline = xlUnderlineStyleNone .ColorIndex = 2 End With Range("V12").SelectEnd SubSub Group645_Click()'' Button #2 Macro' Macro recorded 12/12/2009 by bg'' ActiveSheet.Shapes("Group 645").Select ActiveSheet.Shapes("TextBox 656").Select Selection.Characters.Text = "2" With Selection.Characters(Start:=1, Length:=20).Font .Name = "Tahoma" .FontStyle = "Regular" .Size = 16 .Strikethrough = False .Superscript = False .Subscript = False .OutlineFont = False .Shadow = False .Underline = xlUnderlineStyleNone .ColorIndex = 2 End With Range("V12").SelectEnd Sub -question by Bill George Share this post Link to post Share on other sites
iGuest 3 Report post Posted October 28, 2010 Hi Buddy.. Really superb.. Thanks for your suggestion.. Keep it up.. Regards Ram Share this post Link to post Share on other sites