#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,942
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 157
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10
Default 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
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
what it means in a range (B:B) starguy Excel Discussion (Misc queries) 2 April 12th 06 01:00 PM
hi i would like to know what this means } [email protected] New Users to Excel 1 February 24th 06 09:30 PM
replace ' and what it means jonasa Excel Discussion (Misc queries) 6 February 20th 06 12:30 PM
Can someone tell me what VBA means? (Macro and VBA) AncoatsRed Excel Discussion (Misc queries) 1 January 30th 06 08:36 PM


All times are GMT +1. The time now is 04:01 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"