find in excel replace in word using specific formatting

dean.rogers

New Member
Joined
Apr 6, 2012
Messages
31
Hey all,

I am looking to find text in word and replace it will a cell in excel. That i am able to do perfectly. However I would like to format the data into bullet points. Currently i am using a variable in word to perform the find/replace. That variable maps over as such:

chicago;denver;san francisco;new york;miami

What i'd like to do is once that data maps over to word, to then apply bullet point formatting after each semi-colon.

Here's the code i currently use to map the data:

Dim wrdApp As Word.Application
Dim wrdDoc As Word.Document
Set wrdApp = CreateObject("Word.Application")
wrdApp.Visible = True

Set wrdDocSelection = wrdApp.Selection

With wrdDocSelection.Find
.Text = "[my_variable]"
.MatchWholeWord = False
.Replacement.Text = ActiveWorkbook.Sheets("Sheet2").Range("D5")
.Execute , , , , , , , , , , wdReplaceAll

Something to note is that in the template that i am applying the find/replace to, the variable will be sitting with a bullet point already.
So the way it maps over currently, I have to then go in and manually just hit enter after each semi-colon to to add an additional bullet point.

Any ideas?
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.

Forum statistics

Threads
1,217,292
Messages
6,135,666
Members
449,956
Latest member
nibor

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top