Planar1280 Posted May 26, 2011 Share Posted May 26, 2011 If a totals or numbers in excel are coming in as 4.236. How do we code it in VBA in excel macro so that it rounds to 4.24? Link to comment https://www.neowin.net/forum/topic/1000394-vba-rounding-off-to-2-decimal-places-in-excel-maco/ Share on other sites More sharing options...
0 C:Amie Posted May 26, 2011 Share Posted May 26, 2011 FormatNumber(4.236, 2) Link to comment https://www.neowin.net/forum/topic/1000394-vba-rounding-off-to-2-decimal-places-in-excel-maco/#findComment-594017012 Share on other sites More sharing options...
0 Planar1280 Posted May 26, 2011 Author Share Posted May 26, 2011 On 26/05/2011 at 17:22, C:Amie said: FormatNumber(4.236, 2) If it is any number like 1.236 or 121.877? Link to comment https://www.neowin.net/forum/topic/1000394-vba-rounding-off-to-2-decimal-places-in-excel-maco/#findComment-594017238 Share on other sites More sharing options...
0 Kami- Posted June 11, 2011 Share Posted June 11, 2011 Dim x As Long x = 4.236 Debug.Print (Round(x, 2)) ;) Link to comment https://www.neowin.net/forum/topic/1000394-vba-rounding-off-to-2-decimal-places-in-excel-maco/#findComment-594063700 Share on other sites More sharing options...
Question
Planar1280
If a totals or numbers in excel are coming in as 4.236. How do we code it in VBA in excel macro so that it rounds to 4.24?
Link to comment
https://www.neowin.net/forum/topic/1000394-vba-rounding-off-to-2-decimal-places-in-excel-maco/Share on other sites
3 answers to this question
Recommended Posts