Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #14  
Old 01-10-2021, 06:53 PM
Guessed's Avatar
Guessed Guessed is offline Keep text selected after paste Windows 10 Keep text selected after paste Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,185
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

Using the same principle, this appears to work but is a bit simpler than Greg's code.
Code:
Sub ScratchMacro()
Dim oRng As Word.Range, lngS As Long
  Set oRng = Selection.Range
  lngS = oRng.Start
  oRng.PasteSpecial DataType:=wdPasteText
  oRng.Start = lngS
  oRng.Select
End Sub
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
 

Tags
copy and paste, text selection



Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to find text in between two characters and then format selected text? qcom Word 5 02-19-2015 11:23 PM
Keep text selected after paste Getting mult resps. selected in listbox to concatenate & paste at a bookmark in Word marksm33 Word VBA 3 01-15-2015 05:59 PM
Keep text selected after paste Formatting affecting more than selected text esteban Word 7 05-25-2012 04:34 AM
Keep text selected after paste Do NOT print selected text Tracy Word 2 09-11-2011 07:25 AM
Selected text and logo in one macro marijke Word VBA 0 08-24-2009 07:01 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:55 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