我正在尝试从InputBox获得一种货币值(每三位数和两位小数的逗号。
当我将12345.60放入输入框时,我得到12345.6。我原本希望得到12,345.60。
下面是我的代码的精简版。
Public Sub MoneyTest()
Dim MoneyInput As Currency
MoneyInput = InputBox("What is the Money Input ?")
Set objMsg = Application.CreateItem(olMailItem)
Set objFSO = CreateObject("Scripting.FileSystemObject")
With objMsg
.HTMLBody = MoneyInput
.Display
End With
End Sub
InputBox
函数在对话框中显示提示,等待用户输入文本或单击按钮,并返回包含文本框内容的字符串。