VERSION 5.00 Begin {C62A69F0-16DC-11CE-9E98-00AA00574A4F} FormatCell Caption = "Format Cell" ClientHeight = 1575 ClientLeft = 45 ClientTop = 435 ClientWidth = 5805 OleObjectBlob = "FormatCell.frx":0000 StartUpPosition = 1 'CenterOwner End Attribute VB_Name = "FormatCell" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Private Sub btnBold_Click() Dim intStart As Integer Dim intLength As Integer intLength = Me.TextBox1.SelLength If intLength > 0 Then intStart = Me.TextBox1.SelStart + 1 ActiveCell.Characters(intStart, intLength).Font.Bold = True End If End Sub Private Sub btnExit_Click() Unload FormatCell End Sub Private Sub btnItalic_Click() Dim intStart As Integer Dim intLength As Integer intLength = Me.TextBox1.SelLength If intLength > 0 Then intStart = Me.TextBox1.SelStart + 1 ActiveCell.Characters(intStart, intLength).Font.FontStyle = "Italic" End If End Sub Private Sub btnNormal_Click() Dim intStart As Integer Dim intLength As Integer intLength = Me.TextBox1.SelLength If intLength > 0 Then intStart = Me.TextBox1.SelStart + 1 With ActiveCell.Characters(intStart, intLength).Font .Name = "Arial" .FontStyle = "Regular" .Strikethrough = False .Superscript = False .Subscript = False .Italic = False .OutlineFont = False .Shadow = False .Underline = xlUnderlineStyleNone .ColorIndex = xlAutomatic End With End If End Sub Private Sub btnStrike_Click() Dim intStart As Integer Dim intLength As Integer intLength = Me.TextBox1.SelLength If intLength > 0 Then intStart = Me.TextBox1.SelStart + 1 ActiveCell.Characters(intStart, intLength).Font.Strikethrough = True End If End Sub Private Sub btnSub_Click() Dim intStart As Integer Dim intLength As Integer intLength = Me.TextBox1.SelLength If intLength > 0 Then intStart = Me.TextBox1.SelStart + 1 ActiveCell.Characters(intStart, intLength).Font.Subscript = True End If End Sub Private Sub btnSuper_Click() Dim intStart As Integer Dim intLength As Integer intLength = Me.TextBox1.SelLength If intLength > 0 Then intStart = Me.TextBox1.SelStart + 1 ActiveCell.Characters(intStart, intLength).Font.Superscript = True End If End Sub Private Sub btnSymbol_Click() Dim intStart As Integer Dim intLength As Integer intLength = Me.TextBox1.SelLength If intLength > 0 Then intStart = Me.TextBox1.SelStart + 1 ActiveCell.Characters(intStart, intLength).Font.Name = "Symbol" End If End Sub Private Sub btnTimes_Click() Dim intStart As Integer Dim intLength As Integer intLength = Me.TextBox1.SelLength If intLength > 0 Then intStart = Me.TextBox1.SelStart + 1 ActiveCell.Characters(intStart, intLength).Font.Name = "Times New Roman" End If End Sub Private Sub btnUnderline_Click() Dim intStart As Integer Dim intLength As Integer intLength = Me.TextBox1.SelLength If intLength > 0 Then intStart = Me.TextBox1.SelStart + 1 ActiveCell.Characters(intStart, intLength).Font.Underline = xlUnderlineStyleSingle End If End Sub Private Sub UserForm_Activate() Me.TextBox1 = ActiveCell.Formula End Sub