Results 1 to 3 of 3

How to conditionally format Font Typeface?

Threaded View

  1. #1
    Registered User
    Join Date
    03-27-2008
    Posts
    2

    How to conditionally format Font Typeface?

    Hello All,

    This is my first thread posted, but have used the site as a great resource many times before.

    My Problem: How to conditionally change the font name (typeface) based on the value in the cell.

    Partial Solution: I have used the Worksheet_Calculate Event to successfully change the fontname as follows. It works but negates any 'undo' function available to the user.

    Private Sub Worksheet_Calculate()
        
        Dim Error_Cell As Range
        
        For Each Error_Cell In Range("E21:E30")
        
            If Error_Cell.Value = "@" Then
                Error_Cell.Font.Name = "Webdings"
            ElseIf Error_Cell.Value = "P" Then
                Error_Cell.Font.Name = "Wingdings"
            Else
                Error_Cell.Font.Name = "Wingdings 2"
            End If
        
        Next Error_Cell
    
    End Sub

    My Question: Is there a neater way that conditionally changes the font name that also retains the undo functionality for the user?

    All help is greatly appreciated!

    GB.
    Last edited by dominicb; 03-28-2008 at 05:28 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1