Share via

Changing font size and style in VBA

Anonymous
2024-05-26T18:27:30+00:00

Hey folks. I'm trying to customize my resume for every job I apply to, and I'm using ChatGPT for efficiency. Problem is, when I download the customized resume, it's unformatted. I've already found two scripts to format, say, my job title and dates, but I need to find one to format my contact info and summary section. I want those two to be in bold and underlined, with slightly bigger font. ChatGPT put triple pound signs in front of them, so I'm trying to use that to my advantage. But my script isn't working; it just removes the pound signs. That's it. Here's what I have so far:

***************************************************************************************
Sub Title()

'

' Title Macro

' Turns triple pound signs into bold, underlined bigger text.

Selection.Find.ClearFormatting

Selection.Find.Replacement.ClearFormatting

Selection.Find.Replacement.Font.Bold = True

Selection.Find.Replacement.Font.Underline = True

Selection.Range.Font.Size = 20

With Selection.Find

.Text = "###(*)"

.Replacement.Text = "\1"

.Forward = True

.Wrap = wdFindContinue

.Format = True

.MatchCase = False

.MatchWholeWord = False

.MatchAllWordForms = False

.MatchSoundsLike = False

.MatchWildcards = True

End With

Selection.Find.Execute Replace:=wdReplaceAll

End Sub

*******************************************************************************************************
Can someone help me figure out what went wrong?

Microsoft 365 and Office | Word | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

5 answers

Sort by: Most helpful
  1. Suzanne S Barnhill 277.2K Reputation points MVP Volunteer Moderator
    2024-05-27T11:37:46+00:00

    If you spend the time creating a template that has styles with the formatting you want, creating a résumé based on the template should be just as fast as a macro.

    1 person found this answer helpful.
    0 comments No comments
  2. Charles Kenyon 166.7K Reputation points Volunteer Moderator
    2024-05-27T02:22:50+00:00

    Rather than vba, I would recommend that you apply appropriate styles to your document, perhaps modified to suit.

    If your work is going to involve using Word, you owe it to yourself to lean them.

    1 person found this answer helpful.
    0 comments No comments
  3. Anonymous
    2024-05-27T02:35:13+00:00

    This deleted the number signs, but didn't do anything else, unfortunately...

    0 comments No comments
  4. Anonymous
    2024-05-27T02:28:40+00:00

    I may just give up and use a template. I really wanted to run a macro, since it would be a lot faster, but if not, well... whatever.

    0 comments No comments
  5. Doug Robbins - MVP - Office Apps and Services 322.9K Reputation points MVP Volunteer Moderator
    2024-05-27T00:46:01+00:00

    Try

    Sub Title()

    '

    ' Title Macro

    ' Turns triple pound signs into bold, underlined bigger text.

    Selection.Find.ClearFormatting

    Selection.Find.Replacement.Font.Bold = True

    Selection.Find.Replacement.Font.Underline = True

    Selection.Range.Font.Size = 20

    With Selection.Find

    .Text = "(###)(*)"

    .Replacement.Text = "\2"

    .Forward = True

    .Wrap = wdFindContinue

    .MatchWildcards = True

    End With

    Selection.Find.Execute Replace:=wdReplaceAll

    End Sub

    0 comments No comments