Hi All,
Thanks In Advance,
i need help for amount print in excel
Like my amount field value is 120.20 but in excel its showing 120.2
I did below codes but it didn’t work for me:
- TxtPreAmt :=FORMAT(PremAmt,7,’<precision,2>’);
- xlWorkSheet.Range(‘K’+ FORMAT(J)).Value :=FORMAT(PremAmt,0,’<Precision,2:2><Standard Format,0>’);
- FORMAT(Round(PremAmt,0.01));
- FORMAT(PremAmt,0,’<Decimals,3>’);
- FORMAT(PremAmt,0,’<Precision,2><Decimals,3>’);
in message box value coming properly but in excel trailing 0 is not showing please help
Thanks
Hi All,
Just Got Solution By running Macro
Sub Macro1()
’
’ Macro1 Macro
’
’
ActiveCell.FormulaR1C1 = “120.2”
Range(“A2”).Select
Application.Goto Reference:=“Macro1”
Application.Run “Book1!Macro1”
Selection.ClearContents
Range(“A1”).Select
Selection.NumberFormat = "0.00"
Application.Goto Reference:=“Macro1”
Selection.Merge
Range(“F4”).Select
Selection.Merge
Range(“A3”).Select
So after reading this code i saw highlighted code line of above code
so just added this line below to printing code line and issue resolved.
xlWorkSheet.Range(‘d’+ FORMAT(J)).NumberFormat := ‘#,##0.00’;
Thanks
When you print it excel like
Addcolumn(Amount,’’,’’,false,’#0,00.00’,format::Number). This will automatically put the 120.20, you don’t have to do any format or other functions.