Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Sarah_Lecturer
 
Posts: n/a
Default Enter one value, Return another

Help!

I want to be able to enter a letter in say cell C2 and having pressed enter
return a figure...

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

Any suggestions PLEASE?

Thanks

Sarah

Have it working on a Vlookup table but obviously cannot do this without
having two rows one for the answer and one for the formula - otherwise
circular reference returned!!

Thanks
  #3   Report Post  
Gord Dibben
 
Posts: n/a
Default

To do this in one cell would require VBA.

Here is some event code that will do the trick.

Option Compare Text
Private Sub Worksheet_Change(ByVal Target As Range)
Dim Num As Long
Dim rng As Range
Set rng = Range("C2")
On Error GoTo endit
Application.EnableEvents = False

Select Case rng.Value
Case Is = "A": Num = 12
Case Is = "B": Num = 10
Case Is = "C": Num = 8
Case Is = "D": Num = 6
Case Is = "E": Num = 4
Case Is = "F": Num = 2
Case Is = "U": Num = 0
End Select
rng.Value = Num

endit:
Application.EnableEvents = True
End Sub

Right-click the sheet tab and "View Code". Copy/paste the above in that
module.


Gord Dibben Excel MVP

On Wed, 13 Apr 2005 08:03:17 -0700, "Sarah_Lecturer"
wrote:

Help!

I want to be able to enter a letter in say cell C2 and having pressed enter
return a figure...

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

Any suggestions PLEASE?

Thanks

Sarah

Have it working on a Vlookup table but obviously cannot do this without
having two rows one for the answer and one for the formula - otherwise
circular reference returned!!

Thanks


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
enter data on 1 sheet and make it enter on next avail row on 2nd s Nadia Excel Discussion (Misc queries) 27 September 9th 05 03:39 PM
if the value of a cell in a range is not blank, then return the v. kvail Excel Worksheet Functions 2 April 8th 05 10:07 PM
"Enter" in Macros Desperate Excel Discussion (Misc queries) 4 February 26th 05 03:43 AM
Return the smallest value Donkey Excel Worksheet Functions 2 December 24th 04 10:10 PM
Hyperlink with Enter key CPA Jammer Excel Discussion (Misc queries) 0 December 22nd 04 03:53 PM


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