Home |
Search |
Today's Posts |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If you are dimesioning you variable intPct as an integer, you will get a 0
value. The intPct should be dimensioned as a double to get the decimal value of a percent. Dim intPct As Double "Merlynsdad" wrote in message ... I need to divide two variables by each other to get a percentage. intRows represents the total rows in the spreadsheet. intPerf represents the rows left after I remove some rows with code. intPct = intPerf/intRows. All are dimensioned as integers. When I do the calculation the value in the Watch List of intRows is 88, intPerf is 34. intPct should then be 38.63% but is showing zero. The code for the division is intPct=intPerf/intRows What am I doing wrong? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Dividing by zero | Excel Worksheet Functions | |||
Storing variables in a macro and using those variables to performcalculations. | Excel Programming | |||
Dividing name | Excel Worksheet Functions | |||
Dividing by zero | Excel Discussion (Misc queries) | |||
dividing a row | Excel Worksheet Functions |