Thread: Embedded Font
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Gary''s Student
 
Posts: n/a
Default Embedded Font

Yes. Macro1 selects a cell ( in this case A1) and applies formats to it:


Sub Macro1()
Range("A1").Select
Selection.NumberFormat = "$#,##0.00"
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
With Selection.Font
.Name = "Courier New"
.FontStyle = "Bold"
.Size = 8
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Interior
.ColorIndex = 36
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
End With
End Sub


Macro2 clears all format on the active worksheet:

Sub Macro2()
Cells.Select
Selection.ClearFormats
End Sub

and could be run prior to saving the workbook.

--
Gary's Student


"tomkorver" wrote:


Hi,
Is it possible to have an embedded font?
Is there maybe a macro that will install a font when
you open the sheet, and uninstall it when you exit for example?
Please help me out!
Thanks, Tom


--
tomkorver
------------------------------------------------------------------------
tomkorver's Profile: http://www.excelforum.com/member.php...o&userid=34619
View this thread: http://www.excelforum.com/showthread...hreadid=543951