Perhaps if you explain this in context... but maybe
VB:Sub x() Dim a As Integer Dim b As Integer a = 2 b = 1 MsgBox a + b & "project.xls" End Sub
No, I didn't check the file... not for any reason other than I'm using an Android Pad at the moment....didn't you cheek the attach file
You'll generally find you'll get more timely, and more accurate, replies when you describe your issue in your post. Some users can't, and some are unwilling, to download files. Even if I was using a Windows machine, I don't generally go to the bother of downloading a file, running it through a virus checker (no offence - it's just a sensible thing to do), opening it in Excel to view/read your problem only to find I can't help.
Using a lookup range it can be done - see attached.
I used a column down to 255 rows (you can use less if you know your word length is less).
Lookup the Nth character (based on Nth row) and return the value of that character from the hlookup table.
Then add up the lookup column.
To Sheet1 code module
VB:Private Sub Worksheet_Change(ByVal Target As Range) Dim i As Long With Target If .Address(0, 0) = "B4" Then Application.EnableEvents = False .Offset(, -1).ClearContents If Not .Value Like "*[!a-z]*" Then For i = 1 To Len(.Value) .Offset(, -1).Value = .Offset(, -1).Value + _ Application.HLookup(Mid$(.Value, i, 1), Range("b2:aa3"), 2, True) Next End If Application.EnableEvents = True End If End With End Sub
There are currently 1 users browsing this thread. (0 members and 1 guests)