cqy 发表于 2006-1-10 13:44:00

求助:如何设置小数点?

<P>VBA如何设置小数点?</P>
<P>&nbsp;txtStr = ExcelSheet.cells(1, 1).Value<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; objText = ThisDrawing.ModelSpace.AddText(txtStr, pt, height)</P>
<P>10.00小数点后的0不见了,如何解决?</P>

流星蔡园 发表于 2006-1-11 11:03:00

要不txtStr = cstr(ExcelSheet.cells(1, 1).Value)试试?

cqy 发表于 2006-1-12 14:13:00

<P>用txtStr = cstr(ExcelSheet.cells(1, 1).Value)</P>
<P>还是一样。</P>
<P>&nbsp;</P>

zhuxuhong 发表于 2006-1-12 15:05:00

<DIV>txtStr =str(format( ExcelSheet.cells(1, 1).Value,"######.##"))<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; objText = ThisDrawing.ModelSpace.AddText(txtStr, pt, height)</DIV>
<DIV>试试</DIV>

cqy 发表于 2006-1-12 17:07:00

<P>感谢二位仁兄!</P>
<P>txtStr =format( ExcelSheet.cells(1, 1).Value,"0.00"))</P>
<P>可用。</P>
页: [1]
查看完整版本: 求助:如何设置小数点?