Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Greg
 
Posts: n/a
Default Apply a macro to a specified Cell

Abel,

Did you try it? What do you think?

I don't think so, because before the .Execute statement you have only
changed your mind twice regarding what text you want to find and what
you want that text replaced with.

This would work:

Sub Test1()
Dim myRng As Range
Set myRng = ActiveDocument.Tables(1).Cell(2, 1).Range
With myRng.Find
.Text = "uncle"
.Replacement.Text = "favorit uncle"
.Execute Replace:=wdReplaceAll
.Text = "nefew"
.Replacement.Text = "favorit nefew"
.Execute Replace:=wdReplaceAll
.Text = "sista"
.Replacement.Text = "favorit sista"
.Execute Replace:=wdReplaceAll
End With
End Sub

 
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to wrap text from cell to cell in a table. Jon Coulson Tables 2 August 8th 05 09:12 PM
Macro Button Won't Stay on Toolbar caleb Microsoft Word Help 2 June 14th 05 11:59 PM
Possible bug when recording a Word Macro Raven95 Microsoft Word Help 4 April 30th 05 09:49 PM
2000 to 2002 macro and "Could not open macro storage" Art Farrell Mailmerge 1 December 6th 04 12:40 PM
Macro to set selected cell padding to table default Cindy M -WordMVP- Tables 0 October 28th 04 06:09 PM


All times are GMT +1. The time now is 06:07 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"