Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 04-26-2022, 01:22 AM
Bikram Bikram is offline replacing_within_range Windows 10 replacing_within_range Office 2007
Advanced Beginner
replacing_within_range
 
Join Date: Jul 2021
Location: Nepal
Posts: 97
Bikram is on a distinguished road
Default


Thank you very much Andrew, for the reply. I tried to redefine the rng each time as you did but it still replaces the whole document below the selection. The rng collapses mainly on the 4th item after passing .Execute Replace:=wdReplaceAll before this line the rng was the original range. But when the code passes this line on the 4th item I got the rng = "". I couldn't find any explainable reason on the internet so I tried the following code of line temporarily
Code:
    If i = 4 Then
        .Execute Replace:=wdReplaceOne
    Else
        .Execute Replace:=wdReplaceAll
    End If
Reply With Quote
Reply



Other Forums: Access Forums

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