D
Dan E
I'll provide a little background, I have created a very long and
intricate AGA 8 spreadsheet (calculates gas compressibility).
I would like to have this calculation available to numerous
other spreadsheets. I was hoping I could make an add-in that
would accomplish this.
I am very new to add-ins so . . .
I want to create a function that takes the inputs
Punches them into an existing sheet (contained in the add-in)
Calculates and returns a result from a particular cell on the
sheet.
The reason I want to do this is because if I can't put the info
into the sheet then get the result from the sheet, I will need
to re-program the whole thing in VBA (which is what I'm trying
to avoid)
Sample Code...
Public Function AGA8_92_FULL(Press_PSIA As Single,
Temp_degF As Single, C1 As Single ... ) As Single
Dim CompArray As Variant
AGA8_92C.Range("B2") = Press_PSIA
AGA8_92C.Range("B4") = Temp_degF
CompArray = Array(C1, N2, CO2, C2, ... Ar)
AGA8_92C.Range("B10:B30").Value = CompArray
AGA8_92C.Calculate
AGA8_92C = Range("D10").Value
End Function
Numerous compositional variables removed to save space...
Any thoughts or suggestions are much appreciated.
Dan E
intricate AGA 8 spreadsheet (calculates gas compressibility).
I would like to have this calculation available to numerous
other spreadsheets. I was hoping I could make an add-in that
would accomplish this.
I am very new to add-ins so . . .
I want to create a function that takes the inputs
Punches them into an existing sheet (contained in the add-in)
Calculates and returns a result from a particular cell on the
sheet.
The reason I want to do this is because if I can't put the info
into the sheet then get the result from the sheet, I will need
to re-program the whole thing in VBA (which is what I'm trying
to avoid)
Sample Code...
Public Function AGA8_92_FULL(Press_PSIA As Single,
Temp_degF As Single, C1 As Single ... ) As Single
Dim CompArray As Variant
AGA8_92C.Range("B2") = Press_PSIA
AGA8_92C.Range("B4") = Temp_degF
CompArray = Array(C1, N2, CO2, C2, ... Ar)
AGA8_92C.Range("B10:B30").Value = CompArray
AGA8_92C.Calculate
AGA8_92C = Range("D10").Value
End Function
Numerous compositional variables removed to save space...
Any thoughts or suggestions are much appreciated.
Dan E