I am trying to perform a calculation but instead i get either crazy results or no results at all. It is the first function i created, so i guess the mistake is either when declaring it or calling it. How is it fixed? The procedure:
![]()
Option Explicit Dim x1 As Long, x2 As Long, CO2em As Long, EFCO2 As Long CO2em = Emissions(x1, x2, EFCO2) MsgBox "CO2 emissions = " & CO2em & " t" Function Emissions(ENcat As Long, Ptech As Long, EFtech As Long) Emissions = ENcat * Ptech * EFtech * 10 ^ 6 End Function
Bookmarks