View Single Post
 
Old 09-23-2018, 07:55 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

You could simply replace:
Code:
    Do While .Find.Found = True
      If .InRange(Rng) = False Then Exit Do
      .MoveEnd Unit:=wdCell, Count:=1
      .Text = vbNullString
      .Collapse wdCollapseEnd
      .Find.Execute
    Loop
With:
Code:
    If .Find.Found = True Then
      .MoveEnd Unit:=wdCell, Count:=1
      .Text = vbNullString
    End if
Quote:
Originally Posted by vjvj123 View Post
I am quite worried that the macro which I had written (recorded) earlier by myself did not work the way I wanted. The worry is mainly due to the fact that what seems working when I use the manual sequence of operations using keyboard/mouse (and even when recording the macro), doesn't work the same way when the recorded macro is run. That is, when I press the del key repeatedly in a table cell in the middle of some text, the letters to the left should not be deleted, but running the macro actually deletes the letters to the left also. I would be thankful if you can throw some light (and possible remedy), since I mainly rely on recording macros rather than writing scripts as I am not conversant with that.
Since you haven't posted your own code, it's impossible to know for sure what the issue is.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote