waynecb,
Welcome to the MrExcel forum.
Sample raw data beginning in cell A1:
<b>Excel 2007</b><table cellpadding="2.5px" rules="all" style=";background-color: #FFFFFF;border: 1px solid;border-collapse: collapse; border-color: #A6AAB6"><colgroup><col width="25px" style="background-color: #E0E0F0" /><col /><col /></colgroup><thead><tr style=" background-color: #E0E0F0;text-align: center;color: #161120"><th></th><th>A</th><th>B</th></tr></thead><tbody><tr ><td style="color: #161120;text-align: center;">1</td><td style=";">Daddy</td><td style="text-align: right;;"></td></tr><tr ><td style="color: #161120;text-align: center;">2</td><td style="text-align: right;;"></td><td style="text-align: right;color: #574123;;"></td></tr><tr ><td style="color: #161120;text-align: center;">3</td><td style=";">waynecb </td><td style="text-align: right;color: #574123;;"></td></tr><tr ><td style="color: #161120;text-align: center;">4</td><td style=";">hiker95</td><td style="text-align: right;color: #574123;;"></td></tr><tr ><td style="color: #161120;text-align: center;">5</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr></tbody></table><p style="width:3.6em;font-weight:bold;margin:0;padding:0.2em 0.6em 0.2em 0.5em;border: 1px solid #A6AAB6;border-top:none;text-align: center;background-color: #E0E0F0;color: #161120">Sheet1</p><br /><br />
After the macro:
<b>Excel 2007</b><table cellpadding="2.5px" rules="all" style=";background-color: #FFFFFF;border: 1px solid;border-collapse: collapse; border-color: #A6AAB6"><colgroup><col width="25px" style="background-color: #E0E0F0" /><col /><col /></colgroup><thead><tr style=" background-color: #E0E0F0;text-align: center;color: #161120"><th></th><th>A</th><th>B</th></tr></thead><tbody><tr ><td style="color: #161120;text-align: center;">1</td><td style=";">Daddy</td><td style="text-align: right;;">486</td></tr><tr ><td style="color: #161120;text-align: center;">2</td><td style="text-align: right;;"></td><td style="text-align: right;color: #574123;;"></td></tr><tr ><td style="color: #161120;text-align: center;">3</td><td style=";">waynecb </td><td style="text-align: right;color: #574123;;">777</td></tr><tr ><td style="color: #161120;text-align: center;">4</td><td style=";">hiker95</td><td style="text-align: right;color: #574123;;">641</td></tr><tr ><td style="color: #161120;text-align: center;">5</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr></tbody></table><p style="width:3.6em;font-weight:bold;margin:0;padding:0.2em 0.6em 0.2em 0.5em;border: 1px solid #A6AAB6;border-top:none;text-align: center;background-color: #E0E0F0;color: #161120">Sheet1</p><br /><br />
Please TEST this FIRST in a COPY of your workbook (always make a backup copy before trying new code, you never know what you might lose).
1. Copy the below code, by highlighting the code and pressing the keys
CTRL +
C
2. Open your workbook
3. Press the keys
ALT +
F11 to open the Visual Basic Editor
4. Press the keys
ALT +
I to activate the Insert menu
5. Press
M to insert a Standard Module
6. Where the cursor is flashing, paste the code by pressing the keys
CTRL +
V
7. Press the keys
ALT +
Q to exit the Editor, and return to Excel
8. To run the macro from Excel, open the workbook, and press
ALT +
F8 to display the Run Macro Dialog. Double Click the macro's name to Run it.
Code:
Option Explicit
Sub GetWordValue()
' hiker95, 04/04/2013
' http://www.mrexcel.com/forum/excel-questions/695257-convert-word-numeric-value.html
Dim c As Range, i As Long, n As Long
For Each c In Range("A1", Range("A" & Rows.Count).End(xlUp))
If c <> "" Then
n = 0
For i = 1 To Len(c) Step 1
n = n + Asc(Mid(c, i, 1))
Next i
c.Offset(, 1).Value = n
End If
Next c
End Sub
Before you use the macro with Excel 2007 or newer, save your workbook, Save As, a macro enabled workbook with the file extension
.xlsm
Then run the
GetWordValue macro.