• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Text Fonts

Shazz

Member
Hi All,

Is there a Formula or VBA for if you press t a tick will appear but if you press any other letter the letter will appear?

Thanks in advance.

Shazz
x
 
I have uploaded sheet with vb code. one change you have to make is instead of "t" use letter "P" (caps).
whenever you enter P in C12:C25 , it will change to tick mark
 

Attachments

  • Example (3).xlsm
    21.4 KB · Views: 5
Hi Ashhu,

I don't know what i am doing wrong, but it is coming up with errors, can you take a look at my complete spreadsheet (attached).

Is there any way it can be changed to z instead of p at all? as I came across a problem when i actually want P to be displayed it was showing as the tick.

Shazz
 

Attachments

  • Monthly Paid Timesheet.xlsm
    21 KB · Views: 4
you have not added module code Change() so the Error.
basically i am changing Font type when Cell value is "P" to get symbol. i am not sure how can i change that to any other letter. Sorry
 

Attachments

  • Monthly Paid Timesheet (1).xlsm
    22.9 KB · Views: 6
Than't fine no worries,

I thing I have noticed is when you delete the tick from the cell is stays as Webdings 2, is there any way to have it revert back to ariel when there is nothing in the cell, otherwise you have to change to font if you want to put another letter in there and that is what I am trying to avoid.

Shazz
 
Replace below code in Module, Added Else statement in code,


Code:
Sub Change()

Dim i As Long

Worksheets("Timesheet ").Activate

For i = 12 To 25
    If Range("C1:C25").Cells(i).Value = "P" Then
    Range("C" & i).Font.Name = "Wingdings 2"
    Else
    Range("C" & i).Font.Name = "Arial"
  
End If

Next i

End Sub

Appreciate effort by clicking Like button
 
Play with the attached, an adaptation of Ashhu's code; a small t will add a tick by changing to WingDings2 to and changing it for a P. Entering an upper case P to cell without a tick in will result in P.
The only problem was entering P into a cell already having a tick! 2 Solutions: (a) use a lower case p which will convert to Arial and change into a P and
(b) double-click the cell; if the cell contains just a tick it will blank the cell and convert to Arial, but if the cell is anything else it will just convert to a tick.

You can enter values in several cells at once by shift and selecting (or Ctrl and selecting cells for non-contiguous ranges), entering the letter(s) you want then while holding down the ctrl key, pressing Enter.
 

Attachments

  • chandoo29425Monthly Paid Timesheet.xlsm
    25 KB · Views: 1
Back
Top