Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Convert to number
Hi all -
I have a spreadsheet which queries an external database. On returning the data, it treats numbers as text. The drop-down 'error arrow' appears, inviting me to convert it to a number, which is exactly what I want to do. I need this to be done every time, so I tried recording a Macro to run for me when I chose to convert it but no code was generated by the macro recorder. Does anyone know what code I need to use to simulate this error correcting feature? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Convert to number
Without code:
Put a 1 in an un-used cell and copy the cell. Select the cells you want to convert and paste/special with the multiply button checked. With code: Sub Macro1() Dim r As Range For Each r In Selection r.Value = 1# * r.Value Next End Sub -- Gary's Student "JakeyC" wrote: Hi all - I have a spreadsheet which queries an external database. On returning the data, it treats numbers as text. The drop-down 'error arrow' appears, inviting me to convert it to a number, which is exactly what I want to do. I need this to be done every time, so I tried recording a Macro to run for me when I chose to convert it but no code was generated by the macro recorder. Does anyone know what code I need to use to simulate this error correcting feature? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
convert number to % using only custom number format challenge | Excel Discussion (Misc queries) | |||
Convert a number formatted as text to a number in a macro | Excel Programming | |||
how do I convert a number to number of years, months and days | Excel Worksheet Functions | |||
convert text-format number to number in excel 2000%3f | Excel Discussion (Misc queries) | |||
convert decimal number to time : convert 1,59 (minutes, dec) to m | Excel Discussion (Misc queries) |