Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Simple addition problem
Hello, I've got this line of code:
iVarOutRight(iNumVar) = iVarOutCol(iNumVar) + iVarOutWidth(iNumVar) Simple enough you'd have thought, but it's assuming the values are strings when they are integers as it is concatenating them, for example: 5 + 60 = 560 How do I get it to just add them up to give 65 as the result (for example)? Thanks! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Simple addition problem
Sorry, I worked it out, using:
iVarOutWidth(iNumVar) = CInt(iVarOutWidth(iNumVar)) iVarOutCol(iNumVar) = CInt(iVarOutCol(iNumVar)) If there's a better way let me know, thanks. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Simple addition problem
How are iVarOutCol() and iVaroutWidth() declared/assigned?
If they're both declared/assigned as String, you'll get the concatenation. In article .com, " wrote: Hello, I've got this line of code: iVarOutRight(iNumVar) = iVarOutCol(iNumVar) + iVarOutWidth(iNumVar) Simple enough you'd have thought, but it's assuming the values are strings when they are integers as it is concatenating them, for example: 5 + 60 = 560 How do I get it to just add them up to give 65 as the result (for example)? Thanks! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
simple addition | Excel Discussion (Misc queries) | |||
Simple Addition Function | Excel Worksheet Functions | |||
simple addition | Excel Programming | |||
Simple Math Addition | Excel Programming | |||
My problems with simple addition ... | Excel Programming |