Consulting

Results 1 to 4 of 4

Thread: How to format fonts in VBA?

  1. #1
    VBAX Contributor
    Joined
    Jun 2006
    Posts
    135
    Location

    How to format fonts in VBA?

    Hi, I just need to remove the underlines of a text (It was actually hyperlinks, and I could remove the hyperlink and change the color but I didn't find the command to get ride of the underlines. If you have a link to a list of all font formatting commands for text in VBA it would be great

    Jungix

    [VBA]
    Cells(k, 1).Select
    With Selection
    .HorizontalAlignment = xlCenter
    .VerticalAlignment = xlBottom
    .WrapText = False
    .Orientation = 0
    .AddIndent = False
    .IndentLevel = 0
    .ShrinkToFit = False
    .ReadingOrder = xlContext
    .MergeCells = False
    End With
    Selection.Font.Bold = True
    Selection.Font.ColorIndex = 11
    Selection.Hyperlinks.Delete
    [/VBA]

  2. #2
    Moderator VBAX Master austenr's Avatar
    Joined
    Sep 2004
    Location
    Maine
    Posts
    2,033
    Location
    [VBA] With Selection.Font
    .Underline = xlUnderlineStyleNone

    End With

    [/VBA]
    Peace of mind is found in some of the strangest places.

  3. #3
    VBAX Contributor
    Joined
    Jun 2006
    Posts
    135
    Location
    Thanks for your help. Is there a list of all functions for text formatting somewhere (so that I won't ask you each time I just lack a simple command like that)?

  4. #4
    Moderator VBAX Master austenr's Avatar
    Joined
    Sep 2004
    Location
    Maine
    Posts
    2,033
    Location
    When you are in the VB Editor, open the help files and do a search on Microsoft Excel Constants. Lists them all.
    Peace of mind is found in some of the strangest places.

Posting Permissions

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