#1
|
|||
|
|||
Macro for replacing, copying and undoing.
I use MS Word to basically work around a bunch of limitations in another piece of garbage application my company uses. I write macros to speed things I need to do. One macro I have is:
Code:
Sub ConvertSelectedNumberstoText() ' ' ConvertSelectedNumberstoText Macro ' ' ActiveDocument.ConvertNumbersToText With Selection.Find .Text = "^t" .Replacement.Text = " " .Forward = True .Wrap = wdFindAsk .Format = False .MatchCase = False .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False .Execute Replace:=wdReplaceAll End With Selection.Copy ActiveDocument.Undo End Sub The text in my document that was previously copied is no longer selected, so the remainder of the macro does nothing useful. I think the copy line errors with a nothing is selected error. What I want to know is if it is possible to perform the execute silently not continuing the search. I want it to leave my selection alone so that the remainder of the macro will complete. Anyone have ideas? I see nothing obvious in the Execute method help. Thanks Last edited by macropod; 12-05-2012 at 03:38 PM. Reason: Added code tags & formatting |
#2
|
|||
|
|||
DOH!
,Wrap = wdFindContinue I do actually want it to continue... I often find answers myself the second I post to a forum. Silly me. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Replacing horizontal lines | eosrose | Word VBA | 2 | 06-16-2023 11:58 PM |
Help with replacing text with wildcards | sbatson5 | Word | 2 | 04-13-2012 03:49 AM |
Word replacing problem!!!! | Jamal NUMAN | Word | 2 | 07-08-2011 03:56 AM |
Replacing default fonts | mark98101 | Word | 1 | 01-31-2011 02:31 PM |
Replacing / editting text | LisaC | Word | 0 | 02-25-2010 03:40 AM |