View Single Post
 
Old 02-04-2024, 06:52 AM
vivka vivka is offline Windows 7 64bit Office 2016
Expert
 
Join Date: Jul 2023
Posts: 293
vivka is on a distinguished road
Default

Hi, yacov! If I understand your task correctly, try the following.
Pasting at paragraphs' starts

Technique 1 (manual, I'm sure you know it):
select & copy what you want using Ctrl+A, then place the cursor at the start of each paragraph & press Ctrl+V;
Technique 2 (using a macro):
select & copy what you want using Ctrl+A, then select the paragraphs to paste to & run the following macro:
Code:
Sub Paras_Paste_Start()
Dim Rng As range
Dim oPar As Paragraph
    
    Application.ScreenUpdating = False
    Set Rng = selection.range
    For Each oPar In Rng.Paragraphs
        oPar.range.InsertBefore vbCr & Chr(32)
        oPar.range.Previous.Paste
    Next oPar
Application.ScreenUpdating = False
Set Rng = Nothing
 End Sub
Pasting at paragraphs' ends:
Code:
Sub Paras_Paste_End()
Dim Rng As range
Dim oPar As Paragraph

    Application.ScreenUpdating = False
    Set Rng = selection.range
    For Each oPar In Rng.Paragraphs
        oPar.range.Characters.Last.InsertBefore Chr(32)
        oPar.range.Characters.Last.Previous.Paste
    Next oPar
Application.ScreenUpdating = False
Set Rng = Nothing
 End Sub
If this is not what you want, be more specific.
Reply With Quote