ExcelVBANOOB
New Member
- Joined
- May 7, 2014
- Messages
- 7
I'm working with a code currently, and the calculations are coming out with WAY more sig figs than I need. Is there any way to limit the sig figs of a specific "variable" in VBA? For instance, r1 is the first root from the quadratic equation for a given polynomial, based on coefficients a, b and c. If a=b=c=1, r1 (imaginary)=0.3660254i. That comes out in a message box, so the calculation isn't taking place in a cell, where I can just "activecell.numberformat = "0.000"." Would I need to assign the value to a cell, format the cell, and then take the output, or is there another way?