Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default Don't know if it's possible, but...

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
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default Don't know if it's possible, but...

On Tuesday, August 28, 2012 2:08:32 PM UTC+1, Ron Rosenfeld wrote:
On Tue, 28 Aug 2012 05:36:36 -0700 (PDT), Duncan wrote: 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?


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
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,045
Default Don't know if it's possible, but...

On Tue, 28 Aug 2012 06:21:12 -0700 (PDT), wrote:

On Tuesday, August 28, 2012 2:08:32 PM UTC+1, Ron Rosenfeld wrote:
On Tue, 28 Aug 2012 05:36:36 -0700 (PDT), Duncan wrote: 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?


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
==========================================
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 12:19 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"