Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 02-04-2024, 06:52 AM
vivka vivka is offline paste from clipboard to selected paragraphs Windows 7 64bit paste from clipboard to selected paragraphs Office 2016
Expert
 
Join Date: Jul 2023
Posts: 302
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
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
paste from clipboard to selected paragraphs Replicate the copy/paste function, without involving the clipboard alex100 Word VBA 8 11-09-2020 08:19 AM
Macro for copying in clipboard more than one selected text ghostwhisperer86 Outlook 0 03-31-2019 07:47 AM
paste from clipboard to selected paragraphs How to extract selected hyperlink address to clipboard? poetofpiano Word VBA 8 02-18-2018 07:17 PM
How to paste as a single para from clipboard having multiple paragraph PRA007 Word VBA 8 12-04-2015 04:48 AM
paste from clipboard to selected paragraphs Find & selected paras with highlighted text & copy to clipboard marceepoo Word VBA 1 09-14-2012 08:20 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:52 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft