LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default Can I enter a "Y" and return "Yes" in the same cell? PART 2

Right click on the tab of the sheet you wish to have this behaviour.
In the menu click "View Code"
In the VBA window that opens paste the following code (from '===== to
'=====)

' ==========================================
Private Sub Worksheet_Change(ByVal Target As Range)
Dim cell As Range

Application.EnableEvents = False
For Each cell In Target
Select Case LCase(cell.Text)
Case "y", "yes"
cell = "Yes"
Case "n", "no"
cell = "No"
End Select
Next cell
Application.EnableEvents = True
End Sub
' ==========================================

I made it so that it will also take "no" for an answer. If you don't
want this, remove the lines
Case "n", "no"
cell = "No"

Greetz,

Lex

 
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


Similar Threads
Thread Thread Starter Forum Replies Last Post
If part of a cell = "NVA" then insert "Norfolk" in return cell RNCKWMN Excel Worksheet Functions 4 June 13th 09 08:53 PM
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
change "true" and "false" to "availble" and "out of stock" inthestands Excel Worksheet Functions 2 July 19th 07 07:05 PM
Help!!! Enter "7" in a cell and Excel changes the "7" to "11" immediately!!! [email protected] Excel Discussion (Misc queries) 3 January 5th 07 02:18 PM
Can I enter a "Y" in a cell and have it return a "YES"? How? rbbbbeee Excel Programming 3 August 9th 06 06:18 AM


All times are GMT +1. The time now is 04:36 PM.

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

About Us

"It's about Microsoft Excel"