PDA

View Full Version : [SOLVED:] Need help with Macro to separate bible verses



rsrasc
01-22-2023, 01:09 PM
Hi all,

I found a Bible word document in Bible Hub which has over 2000 pages. Basically, I would like some help so the macro can add or insert a new (blank) paragraph before a number.

For example, see below

15 Then on the seventh day, they got up at dawn and marched around the city seven times in the same manner. That was the only day they circled the city seven times. 16 After the seventh time around, the priests blew the horns, and Joshua commanded the people, “Shout! For the LORD has given you the city! 17 Now the city and everything in it must be devoted to the LORD for destruction. c (http://www.vbaexpress.com/forum/#fn) Only Rahab the prostitute and all those with her in her house will live, because she hid the spies we sent. 18 But keep away from the things devoted to destruction, lest you yourself be set apart for destruction. If you take any of these, you will set apart the camp of Israel for destruction and bring disaster upon it. 19 For all the silver and gold and all the articles of bronze and iron are holy to the LORD; they must go into His treasury”.

After the macro is applied, the text would looks like this:

15 Then on the seventh day, they got up at dawn and marched around the city seven times in the same manner. That was the only day they circled the city seven times.

16 After the seventh time around, the priests blew the horns, and Joshua commanded the people, “Shout! For the LORD has given you the city!

17 Now the city and everything in it must be devoted to the LORD for destruction. c (http://www.vbaexpress.com/forum/#fn) Only Rahab the prostitute and all those with her in her house will live, because she hid the spies we sent.

18 But keep away from the things devoted to destruction, lest you yourself be set apart for destruction. If you take any of these, you will set apart the camp of Israel for destruction and bring disaster upon it.
19 For all the silver and gold and all the articles of bronze and iron are holy to the LORD; they must go into His treasury”.

Currently the verse numbers are highlighted with the following RGB colors:

Red: 179
Green: 71
Blue: 0
Hex: B34700

Not sure how long it will take to run the macro for the whole document but if the macro can be run on a selection that will be fine. I attached an image of the colors but I can't see it.

As always thank you for your support.

Cheers!

macropod
01-22-2023, 01:57 PM
You don't even need a macro for that! All you need is a wildcard Find/Replace, where:
Find = ( )([0-9]]
Replace = ^p\2

rsrasc
01-22-2023, 04:02 PM
Hi Macropod,

Thank you for your find & replace.

I applied your find and replace but does not work.

Probably the info I provided is wrong. There may be more to it.


I'm attaching a sample of the document.

Hope this will help.

Time to leave the forum. Be back in the morning. It's midnight in Germany.

Regards!

macropod
01-22-2023, 04:14 PM
The F/R expression works just fine (perhaps too well). Did you check the 'use wildcards' option?

Given your document's content, you might find that:
( )([0-9]@?[A-Za-z])
works better for the Find expression.

rsrasc
01-23-2023, 12:12 AM
Hi Macropod, with the initial code I checked the wildcard option. Ran the updated F/R expression and did the trick. Thanks!