Hello there.
I am familiar with macros in excel, but would appreciate some help on this one.
Here are some of the things I need to do. In a word doc with lets say thousands of lines of text, I need a macro that will insert a bit of text at the end of each and every line. I would also need to create another macro that would insert another bit of text at the beginning of every line. Thirdly, a macro that could insert text of my choosing after the nth character of every line. Those three macros would make my life VERY VERY easy since I need to go through tens of thousands of lines and really don't want to cut and paste each one.
Any help would be greatly appreciated!
Please see sample file for clarification.
Hello everyone. I found some code that gives me the ability to insert text at the beginning of every line and also at the end of every line:
Sub AddHello()
Dim oRg As Range
Set oRg = Selection.Range
With oRg.Find
.MatchWildcards = True
.ClearFormatting
.Replacement.ClearFormatting
.Text = "([!^13]{1,}^13)"
.Replacement.Text = "hello\1"
.Wrap = wdFindStop
.Execute Replace:=wdReplaceAll
End With
Set oRg = Nothing
End Sub
I'm 2 thirds the way there! What I really need now is a macro that will insert text every nth character of every row. Anyone have any ideas?
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks