I'm trying to clean up subtitles using VBA.
I want to enforce these rules:
a) After comma, period, colon and semicolon there should always be a space, unless it's the end of a line.
a) Exception: 2 or 3 dots "..." should have space after, but not in between. (Might not be needed due to next rule)
b) There cannot be a space before comma, period, colon or semicolon.
c) Before a parenthesis-start there should always be a space, unless it's the beginning of a line.
d) After parenthesis-end there should always be a space, unless the next char is comma, period, colon or semicolon, or the end of a line.
e) Remove any spaces at the beginning or end of a line.
Please see the attached example.
1) At the 2nd line there's an excess space before the period. This should go.
2) Again an excess space before the period, but the space after is fine.
3) Excess space before the period, AND there can be no space after the period, since it's the end of a line.
4) Missing space before parenthesis-start, and after comma.
Bookmarks