How to edit?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

to convert following

aaa
sss
ggg

into

aaasssggg

without placing the cursor at the end of each line and pressing delete key
again and again. a lot of thanks for the help.
 
Select the text and run a macro something like this:

Sub Scratchmacro()
Dim i As Long
Dim j As Long
i = Selection.Paragraphs.Count
Selection.Collapse wdCollapseStart
For j = 1 To i
Selection.MoveEndUntil Chr(13)
Selection.Characters.Last.Next.Delete
Next
End Sub
 
In addition/alternative to what the others said... select the lines you want
concatenated, press Ctrl+H (Find/Replace) and set the following:

Find what:^p

Replace with:[leave empty]

Note: I assume you've selected what you want concatenated, otherwise,
clicking Replace All will work on the entire document, not just where you
want.

Click Replace All, then click No when it offers to do the rest of the
document.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

PLEASE HELP - MACRO NEEDED 2
Calculate post and show number for every post 1
Find Mismatched Data 5
Seperate row to Column. 5
Script to ping a server. 0
row comparison 5
UDF Sort Function 1
Lookup with loop 3

Back
Top