Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
x means Y
How can I change a cell to either "Y" or "N" if the user enters "x".
i.e. If the user enters "x" in G12 and presses enter or moves to another cell, that cell, G12, changes to "Y". Or the user enters "x" in H12 and presses enter or moves to another cell, that cell, H12, changes to "N". Thanks in advance for any help. And I hope I made sense. |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
x means Y
hi
sounds like all you need to do is add an entry into your auto correct options. 2003 toolsautocorrect optionsfollow the wizard. regards FSt1 "MitzDriver" wrote: How can I change a cell to either "Y" or "N" if the user enters "x". i.e. If the user enters "x" in G12 and presses enter or moves to another cell, that cell, G12, changes to "Y". Or the user enters "x" in H12 and presses enter or moves to another cell, that cell, H12, changes to "N". Thanks in advance for any help. And I hope I made sense. |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
x means Y
"MitzDriver" wrote in message
... How can I change a cell to either "Y" or "N" if the user enters "x". i.e. If the user enters "x" in G12 and presses enter or moves to another cell, that cell, G12, changes to "Y". Or the user enters "x" in H12 and presses enter or moves to another cell, that cell, H12, changes to "N". Thanks in advance for any help. And I hope I made sense. This solution works in Excel 2000 so will most likely work in newer versions. Each time a cell is changed, the code looks at G12 & H12 to see if either of them contain x. Note that it is case specific so entering X will have no effect. I don't know if you are familiar with using code in Excel. If not, then open your worksheet, right-click on the tab and select "View code". In the window that opens, copy the code into the top left pane. If there is already some code there, copy this code at either the beginning or the end, not in the middle. Private Sub Worksheet_Change(ByVal Target As Range) Application.EnableEvents = False On Error GoTo sub_exit If Not Intersect(Target, Range("G12")) Is Nothing Then With Target If .Value = "x" Then .Value = "Y" End If End With End If If Not Intersect(Target, Range("H12")) Is Nothing Then With Target If .Value = "x" Then .Value = "N" End If End With End If sub_exit: Application.EnableEvents = True End Sub -- Ian -- |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
x means Y
Perfect....you guys are great.
Thanks for the help!!! "IanC" wrote: "MitzDriver" wrote in message ... How can I change a cell to either "Y" or "N" if the user enters "x". i.e. If the user enters "x" in G12 and presses enter or moves to another cell, that cell, G12, changes to "Y". Or the user enters "x" in H12 and presses enter or moves to another cell, that cell, H12, changes to "N". Thanks in advance for any help. And I hope I made sense. This solution works in Excel 2000 so will most likely work in newer versions. Each time a cell is changed, the code looks at G12 & H12 to see if either of them contain x. Note that it is case specific so entering X will have no effect. I don't know if you are familiar with using code in Excel. If not, then open your worksheet, right-click on the tab and select "View code". In the window that opens, copy the code into the top left pane. If there is already some code there, copy this code at either the beginning or the end, not in the middle. Private Sub Worksheet_Change(ByVal Target As Range) Application.EnableEvents = False On Error GoTo sub_exit If Not Intersect(Target, Range("G12")) Is Nothing Then With Target If .Value = "x" Then .Value = "Y" End If End With End If If Not Intersect(Target, Range("H12")) Is Nothing Then With Target If .Value = "x" Then .Value = "N" End If End With End If sub_exit: Application.EnableEvents = True End Sub -- Ian -- |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
what it means in a range (B:B) | Excel Discussion (Misc queries) | |||
hi i would like to know what this means } | New Users to Excel | |||
replace ' and what it means | Excel Discussion (Misc queries) | |||
Can someone tell me what VBA means? (Macro and VBA) | Excel Discussion (Misc queries) |