Consulting

Results 1 to 5 of 5

Thread: Need help with Macro to separate bible verses

  1. #1
    VBAX Regular
    Joined
    Apr 2011
    Posts
    72
    Location

    Need help with Macro to separate bible verses

    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 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 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!

  2. #2
    Knowledge Base Approver VBAX Guru macropod's Avatar
    Joined
    Jul 2008
    Posts
    4,435
    Location
    You don't even need a macro for that! All you need is a wildcard Find/Replace, where:
    Find = ( )([0-9]]
    Replace = ^p\2
    Cheers
    Paul Edstein
    [Fmr MS MVP - Word]

  3. #3
    VBAX Regular
    Joined
    Apr 2011
    Posts
    72
    Location
    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!
    Attached Files Attached Files

  4. #4
    Knowledge Base Approver VBAX Guru macropod's Avatar
    Joined
    Jul 2008
    Posts
    4,435
    Location
    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.
    Cheers
    Paul Edstein
    [Fmr MS MVP - Word]

  5. #5
    VBAX Regular
    Joined
    Apr 2011
    Posts
    72
    Location
    Hi Macropod, with the initial code I checked the wildcard option. Ran the updated F/R expression and did the trick. Thanks!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •