View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
Hoyos Hoyos is offline
external usenet poster
 
Posts: 74
Default Calculations using vb code?

Thanks Mike,
Does that go in the sheet2 code or the userform code?

"Mike H" wrote:

Hi,

Sub addup()
Dim MSht As Variant
Set MSht = Sheets("Sheet2")
With MSht
MTot = .Range("B1") / 28 + .Range("B3")
MyOthertot = (1013 - .Range("B4")) * 28
End With
End Sub


Mike

"hoyos" wrote:

How can I the following formula into a vb code.

=SUM(Sheet2!B1/28)+Sheet2!B3
and
+SUM(1013-Sheet2!B4)*28

Any ideas?