0

我试图将计算出的返回值粘贴到选定的单元格中,但是,消息框中的返回值与粘贴到单元格中的值不同。为什么是这样?

Sub CalcmsgboxAcre()
    On Error Resume Next
    Dim num As Double
    num = Application.InputBox(prompt:="Please Enter The Number Of Hectares You Would Like To Calculate Into Acres ", Type:=1)
    MsgBox Format(num * 2.471054, "#,##0.00") & " Is the Number Of Acre's."
        num = MsgBox("Do you want to paste the result in a cell?", vbYesNo)
        If num = vbYes Then
            cell = Application.InputBox("Type In The Cell Reference")
            Range(cell).Value = num * 2.471054

        End If
End Sub
4

1 回答 1

1

您正在为 num 分配一个新值:

num = MsgBox (...)

所以vbYes乘以因子然后进入单元格。

于 2013-05-26T05:44:20.787 回答