View Single Post
  #3   Report Post  
Sarah_Lecturer
 
Posts: n/a
Default

So, If I wanted to expand from C2 could I just add C2:E2 for example?

Thanks so much for your help - perfect so far....

Thanks again

Sarah

"JulieD" wrote:

Hi

you need to use worksheet_change code
e.g.
---
Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo err_handler
Application.EnableEvents = False
If Target.Address = "$C$2" And Target.Value < "" Then
Select Case UCase(Target.Value)
Case "A"
Target.Value = 12
Case "B"
Target.Value = 10
Case "C"
Target.Value = 8
Case "D"
Target.Value = 6
Case "E"
Target.Value = 4
Case "F"
Target.Value = 2
Case "U"
Target.Value = 0
End Select
End If
err_handler:
Application.EnableEvents = True
End Sub
---
to use this code, right mouse click on the sheet tab of the sheet you want
it to run on
choose view code
copy & paste the above code in the right hand side of the screen
use ALT & F11
to switch back to your workbook and test

--
Cheers
JulieD
check out www.hcts.net.au/tipsandtricks.htm
....well i'm working on it anyway
"Sarah_Lecturer" wrote in message
...
HELP!

I want to enter a letter in cell C2 and upon pressing ENTER on the
keyboard
get Excel to return a value into cell C2 (depending on the letter entered
in).

A = 12
B = 10
C = 8
D = 6
E = 4
F = 2
U = 0

I have tried using a VLOOKUP but because I want to enter A and receive 12
in
the same cell I keep ending up with circular references - help!!!

Thanks

Sarah