Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I have a user interface which stores the inputted data onto a separate sheet however when I come to pull the total amount off of the data sheet it wont pick it up, the cell is asking me to Convert numbers stored as text to number. I can get it to pick up if I manually change it so it converts to a number but I want the macro to do this for me automatically, does anyone have any ideas? For example if i do a basic =Sum(A1:A5) then it will not pick up the text number however =sum(A1+A2+A3+A4+A5) will. Your help is appreciated Kind regards Rob Evans 07869214171 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
First - find out why you are storing numbers as text in the first place -
should be able to fix the problem there. If not, the standard way to convert taxt back to numbers is to copy a cell containing the number 1 and paste special / multiply (alt+e, s, m on the keyboard) onto your cells containing numbers stored as text values. So in code you would need something like: Dim rng1 As Range 'cellcontaining the number 1 Dim rngText As Range 'range containg your text numbers rng1.Copy rngText.PasteSpecial Operation:=xlPasteSpecialOperationMultiply "Robjevans83" wrote: I have a user interface which stores the inputted data onto a separate sheet however when I come to pull the total amount off of the data sheet it wont pick it up, the cell is asking me to Convert numbers stored as text to number. I can get it to pick up if I manually change it so it converts to a number but I want the macro to do this for me automatically, does anyone have any ideas? For example if i do a basic =Sum(A1:A5) then it will not pick up the text number however =sum(A1+A2+A3+A4+A5) will. Your help is appreciated Kind regards Rob Evans 07869214171 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
One way:
=SUMPRODUCT(--(A1:A5)) Personally, I think I'd fix the range so that it's really numbers. You may remember to fix this one formula, but I would be scared that I'd miss references in other formulas. I use this technique: Select an empty cell Edit|copy Select the range to fix Edit|paste special|check Add and values. Robjevans83 wrote: I have a user interface which stores the inputted data onto a separate sheet however when I come to pull the total amount off of the data sheet it wont pick it up, the cell is asking me to Convert numbers stored as text to number. I can get it to pick up if I manually change it so it converts to a number but I want the macro to do this for me automatically, does anyone have any ideas? For example if i do a basic =Sum(A1:A5) then it will not pick up the text number however =sum(A1+A2+A3+A4+A5) will. Your help is appreciated Kind regards Rob Evans 07869214171 -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Convert text number to number formate | Excel Discussion (Misc queries) | |||
Convert a number formatted as text to a number in a macro | Excel Programming | |||
convert text-format number to number in excel 2000%3f | Excel Discussion (Misc queries) | |||
not able to convert text, or graphic number to regular number in e | Excel Worksheet Functions | |||
Convert number in text format to number | Excel Programming |