View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
GB GB is offline
external usenet poster
 
Posts: 230
Default error convert to number macro

Versed or not, you could begin recording a macro before attempting to convert
one cell. After that, you can use the resulting code to move from cell to
cell, and do a comparison of the cell to see if it is fully numeric. (I say
fully, because I can not remember if the function that tests if it is numeric
stops at the first character, or if it looks at the whole piece of data.) If
the full text of the cell is numeric then do the conversion that was recorded
before. If not, then go to the next cell that is to be "tested".

You should be able to construct what you need/want from that.

"cherrynich" wrote:

Hello all-
I am attempting to make a macro that will make a pivot table that uses a
field that is a list of management areas where some are alphanumeric(6W,9T),
some are numeric(15,16,17). When I export the data I need from our oracle
database to excel(excel5 with headers), the whole management area field comes
up as text. The numeric data comes up with excel errors the ones with the
green dog ear in the corner. To fix the error I highlight these cells and
click the exclamation point icon that appears, and select the option to
convert text to number. That solves the problem. I want to record a macro
to accomplish this. If anyone knows how to do this. I need to know, I'm
fairly versed in VB if anyone has any code for this. Thank you!!!