2013-05-26 36 views
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 

回答

1

您分配一個新的價值NUM:

num = MsgBox (...) 

所以vbYes得到由係數相乘,然後進入細胞。

+0

因此,我需要暗淡保存並更改數字後保存MSG格式,你大男人,謝謝兄弟! –

相關問題