View Single Post
 
Old 10-27-2016, 09:56 AM
dwirony dwirony is offline Windows 7 64bit Office 2003
Advanced Beginner
 
Join Date: Oct 2016
Posts: 49
dwirony will become famous soon enough
Default How to Dim a substring between two strings

Hello all,

I am trying to Dim some text as a variable for another macro of mine. For example, the value I want to Dim is located between the words "to host the" and "group at the location". Once I have the variable, I want to use it to fill in other paragraphs throughout my document, something like this -

Code:
With Selection.Find
        .Text = "The event is to be held with the designated group at the location"
        .Replacement.Text = "The event is to be held with the " & Dim VARIABLE & " group at the location"
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
Any solutions to how I could go about this?
Reply With Quote