PDA

View Full Version : How to format fonts in VBA?



jungix
06-22-2006, 08:03 AM
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


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

austenr
06-22-2006, 08:12 AM
With Selection.Font
.Underline = xlUnderlineStyleNone

End With

jungix
06-22-2006, 08:31 AM
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)?

austenr
06-22-2006, 08:52 AM
When you are in the VB Editor, open the help files and do a search on Microsoft Excel Constants. Lists them all.