Multi-Format text based on content

jonarnold

New Member
Joined
Feb 10, 2015
Messages
1
Hi-

I'm very new to Excel programming, but am trying to create a tool for our church.

I need to be able to format a cell based on its content like the following:

Code:
Make a joyful noise to the Lord all the earth.
[B]Worship the Lord with gladness; come into his presence with singing.[/B]
Know that the Lord is God.  It is he that made us, and we are his;
[B]We are his people, and the sheep of his pasture.[/B]


[COLOR=#ff0000][I](Silence for reflection on the goodness of our God)[/I][/COLOR]


Lord, we gather to worship you in praise and thanksgiving.  We praise you, Holy Father for the gift of life.
[B]We praise you for the gift of your Son, who was raised, who promises resurrection to all who believe.[/B]
We praise you for the your sustaining Spirit which carries us through weariness and darkness into strength and light.
[B]We praise you, O Lord.  Accept our heartfelt worship and praise.  Amen.[/B]

Note the bold, italics, and red.

I'm guessing the only way to do this is to indicate properties with special characters, so I could use the parentheses to indicate red/italic and braces to indicate bold.
I would need to strip out the braces in the final product, though.

I need help with strategy: is the best way to gather the InStr of each of these characters into separate arrays and then bold the ranges in between? Should I create an array of each line first?
I'm not even sure if InStr will return multiple occurrences.

I'm using Excel 2013.

Thanks so much for any help.
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.

Forum statistics

Threads
1,224,600
Messages
6,179,836
Members
452,947
Latest member
Gerry_F

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