You are here:

Excel/Changing field to numeric


I have a 17-digit alphanumeric field (ie: 1AB1BLK34WY100100). I used =MID($A$1,D1,1) to separate each character into it's own cell (D1 = 1 thru 17). Now the problem, I copy + paste special (Value) all 17 cells into another field. I have to manually change to numeric value each of the cells that are numeric to make my vlookup work.

My vlookup is (=IF(ISTEXT(S8),VLOOKUP(S8,$AA$2:$AB$34,2,FALSE),S8).
This formula works, I just don't want to have to copy + paste special (value) then change each field to numeric value every time I have a new SFC#. Is there an easier way to convert a field to numeric even though there is a alphabet in the cell?

Can you help? Thanks!

Hi Allan,

You can write a little macro which could do the job for you on the entire range in one go. I found this solution on another site which will surely meet your requirements:

Private Sub Command1_Click()
Range("H:H").select 'this can be your required range
With Selection
Selection.Numberformat = "General"
End With
End Sub

Hope this helps,
About Excel
This topic answers questions related to Microsoft Excel spreadsheet (or workbook) stand-alone or Mircrosoft Office Excel including Excel 2003, Excel 2007, Office 2000, and Office XP. You can get Excel help on Excel formulas(or functions), Excell macros, charting in Excel, advanced features, and the general use of Excel. This does not provide a general Excel tutorial nor the basics of using a spreadsheet. It provides specific answers to using Microsoft Excel only. If you do not see your Excel question answered in this area then please ask an Excel question here


All Answers

Answers by Expert:

Ask Experts




I can answer questions related to the following topics: 1. MS Excel - Creating and Linking Formulae, Running Pivot Tables, Vlookup etc. 2. Macros / VBA - Creating Macros to do specific jobs. Importing / Exporting / Validating Data in excel through Macros.


I've been working on excel for over 10 years and on VBA macros for over 3 years now.

Bachelor of Commerce, Chartered Accountant from The Institute of Chartered Accountants of India

©2017 All rights reserved.