Create Account

Username
Password
Remember me
Email
 
1

microsoft office macro help

6 comments, 403 views, posted 6:11 pm 19/05/2011 in Microsoft by cyvoid
cyvoid has 3378 posts, 635 threads, 107 points
victim of the masses

I needs some

lets say i have a document template that has requires the same name to be placed in the document at 10 different places. Always at the same places. Is there a macro or something that would allow me to type it once, and it automatically be placed in the remainder of the locations?

Thanks

Comments

1
6:27 pm 19/05/2011

Rosie

There is something in options that allows autocompletes. That's why you don't have to totally type out "November"...by the time you get to "Nov" it pops up as an option.

1
7:49 pm 19/05/2011

thecrookedman

A macro that prompts you for text, then uses it in a find-and-replace would enter your string wherever you had a placeholder in the document.

1
7:53 pm 19/05/2011

thecrookedman

Something like this (though this is Excel).

sub replace ()
What = InputBox("word to search")
repl = InputBox("word to replace")
Sheets().Select

Selection.Replace What:=What, Replacement:=repl, LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
End Sub

Source

1
8:17 pm 19/05/2011

blackspy

Word? Alt-E, F, Click replace

1
8:17 pm 19/05/2011

Gazdoc

In Word you could enter something like @@@ in the each of the 10 locations in the template, then use the find and replace tool to drop the name in....
Save new copy, discard changes on original...

1
9:25 pm 19/05/2011

Flee

Quote by thecrookedman:
A macro that prompts you for text, then uses it in a find-and-replace would enter your string wherever you had a placeholder in the document.

What if the cell is originally blank? I guess you could originally put "@@@" as Gazdoc said and rind/replace that.

If you have an existing template with blank cells where the data should be, could you not just do something like "=A1" in the 9 other cells and save the template? (if Excel).

If its word, I recommend using Excel

Add Comment

Log in via teoti, or register to add a comment!