#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default vlookup

I still need help with writing this program...can anyone
help?

my range is L2:M12
I am using 10 letters to represent numbers 1,2..8,9,0
those letters are to be typed in the "D" column, no more
than 6 consecutive letters (they will not represent a
value greater than $9,999.99

Please help...

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default vlookup

Your post does not state what you are confused about.

It also doesn't state what problem you want to solve.

You can use data validation to restrict entries in column D

It is unclear how range L2:M12 plays in the problem.

It is unclear what you want the "program" to do.
--
Regards,
Tom Ogilvy


"still confused" wrote in message
...
I still need help with writing this program...can anyone
help?

my range is L2:M12
I am using 10 letters to represent numbers 1,2..8,9,0
those letters are to be typed in the "D" column, no more
than 6 consecutive letters (they will not represent a
value greater than $9,999.99

Please help...



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default vlookup

You can't type letters into a cell in column D and have them appear as
numbers using a formula.

You would need to write code for that (or perhaps use autocorrect - but I
would imagine that might be complex - setting it up and clearing it using
selectionchange event).

right click on the sheet tab of the worksheet where you want this behavior

select view code.

Paste in this code:

Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo ErrHandler
Dim sStr As String, sStr1 As String
Dim i As Long, sChr As String, res As Variant
If Target.Count 1 Then Exit Sub
If Target.Column = 4 Then
If IsEmpty(Target) Then Exit Sub
sStr = Trim(Target.Value2)
If Len(sStr) 6 Then
Target.ClearContents
Exit Sub
End If
If IsNumeric(sStr) Then Exit Sub
sStr1 = ""
Set rng = Range("L2:M12")
For i = 1 To Len(sStr)
sChr = Mid(sStr, i, 1)
res = Application.VLookup(sChr, rng, 2, False)
If Not IsError(res) Then
sStr1 = sStr1 & res
Else
sStr1 = sStr1 & "-"
End If
Next
If IsNumeric(sStr1) Then
Application.EnableEvents = False
Target.Value = CDbl(sStr1) / 100
Target.NumberFormat = "$ #,##0.00"
End If
Else

End If
ErrHandler:
Application.EnableEvents = True
End Sub

--
Regards,
Tom Ogilvy



"Tom Ogilvy" wrote in message
...
Your post does not state what you are confused about.

It also doesn't state what problem you want to solve.

You can use data validation to restrict entries in column D

It is unclear how range L2:M12 plays in the problem.

It is unclear what you want the "program" to do.
--
Regards,
Tom Ogilvy


"still confused" wrote in message
...
I still need help with writing this program...can anyone
help?

my range is L2:M12
I am using 10 letters to represent numbers 1,2..8,9,0
those letters are to be typed in the "D" column, no more
than 6 consecutive letters (they will not represent a
value greater than $9,999.99

Please help...





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 783
Default vlookup

Tom Ogilvy wrote:
You can't type letters into a cell in column D and have them appear as
numbers using a formula.


Well, it certainly isn't clear what the OP is needing to do, but if a is
defined to be 1, b is defined to be 2 and d is defined to be 3 (c is not
available as a defined name), then typing

=a&b&d into Cell D1 will return 123 to that cell.

Alan Beban
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default vlookup

she has a conversion table in L2:M12

--
Regards,
Tom Ogilvy

"Alan Beban" wrote in message
...
Tom Ogilvy wrote:
You can't type letters into a cell in column D and have them appear as
numbers using a formula.


Well, it certainly isn't clear what the OP is needing to do, but if a is
defined to be 1, b is defined to be 2 and d is defined to be 3 (c is not
available as a defined name), then typing

=a&b&d into Cell D1 will return 123 to that cell.

Alan Beban



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
If (Vlookup 0) working, but what if Vlookup cell does not exist Steve Excel Worksheet Functions 18 November 18th 09 07:33 PM
Vlookup in vlookup - taking the result as array name SupperDuck Excel Worksheet Functions 2 June 2nd 07 11:05 AM
Combine VLOOKUP and IF function so #NA isn't returned as a value from VLOOKUP buffgirl71 Excel Discussion (Misc queries) 12 November 14th 06 11:36 PM
Vlookup -=VLOOKUP(F9,LookUp1!$A$2:$B$1504,2,FALSE) MikeR-Oz New Users to Excel 1 March 22nd 06 09:01 AM
Vlookup info being used without vlookup table attached? Excel Worksheet Functions 0 January 25th 05 10:43 AM


All times are GMT +1. The time now is 11:57 PM.

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"