View Single Post
  #9   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Much help needed on conversion!

I think you want event code then. Change the range that the input applies to
and add the cases

Option Explicit

Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "H1:H10"

On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target
Select Case .Value
Case "voltage": .Value = 101
Case "something": .Value = 200
Case "something else": .Value = 300
End Select
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.


--

HTH

RP
(remove nothere from the email address if mailing direct)


"oOpsy" wrote in
message ...

Kaak: Thanks for the code! I'm trying it out but do i place the codes
under the module? Sorry abt this

Bob Phillips : Yeap i need to translate 'voltage' into numerals such as
'101' cos i'm creating this file whereby it will be read by my labview
program which is only capable of reading in numerals . i want to let
users to just select 'voltage' instead of typing in all those numerals
which makes no sense to them


--
oOpsy
------------------------------------------------------------------------
oOpsy's Profile:

http://www.excelforum.com/member.php...o&userid=29132
View this thread: http://www.excelforum.com/showthread...hreadid=488525