Don't know if it's possible, but...

K

kilted_scot

What I want to do is, if the user enters the value 'F' in any cell on the spreadsheet, I want that cell to display a character from the WingDings font--an arrow. If the enter the value 'B' in any cell, I want it to display another character from WingDings. I don't want it to display the WingDing equivalent of the 'F' or 'B', which is what I have at the moment.

Can anyone assist?

Duncan
 
R

Ron Rosenfeld

What I want to do is, if the user enters the value 'F' in any cell on the spreadsheet, I want that cell to display a character from the WingDings font--an arrow. If the enter the value 'B' in any cell, I want it to display another character from WingDings. I don't want it to display the WingDing equivalent of the 'F' or 'B', which is what I have at the moment.

Can anyone assist?

Duncan

Ordinarily, to change how a cell looks, you would use Conditional Formatting.

But I don't know how to do that as the font name is not a property of the conditional formatting object.

You could use an event macro which would actually change the value and formatting of the cell. That would destroy your original entry. Would that be acceptable?
 
K

kilted_scot

That is exactly what I want. If an 'F' is entered, forget about the 'F' and instead put in a character from the WingDings font.

Duncan
 
R

Ron Rosenfeld

On said:
That is exactly what I want. If an 'F' is entered, forget about the 'F' and instead put in a character from the WingDings font.

Duncan

The following assumes that when you write "entered", you mean that the F will be the only character in the cell, and that it will not need to change until after you have made the entry into the cell.
If you need any F anyplace within the cell to change to the up arrow, this can be done but, again, not until after you have hit <enter> and confirmed the entry.
If you need it to change "as you type", I don't know of any Excel or VBA based method to intercept the key strokes and make that change. But try the code below:

To enter this event-triggered Macro, right click on the sheet tab.
Select "View Code" from the right-click drop-down menu.
Then paste the code below into the window that opens.

Be sure to set r to the range where you want this to occur. In the code, it is set to column A

======================================
Private Sub Worksheet_Change(ByVal Target As Range)
Dim r As Range, c As Range
Set r = Range("A:A")
If Not Intersect(r, Target) Is Nothing Then
Application.EnableEvents = False
For Each c In Intersect(r, Target)
With c
Select Case .Value
Case Is = "F"
.Font.Name = "Wingdings"
.Value = Chr(225)
Case Is = "B"
.Font.Name = "Wingdings"
.Value = Chr(224)
Case Else
.Font.Name = "Calibri"
End Select
End With
Next c
Application.EnableEvents = True
End If
End Sub
==========================================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top