Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 53
Default An Add-in question

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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 53
Default An Add-in question

I guess I should mention that the problem is that you cannot
pass arguments to the spreadsheet from within the function.

The code always ends at:
AGA8_92C.Range("B2") = Press_PSIA

Any (and I mean ANY) ways around this (VB, C++, MATLAB)
anything that I could use without rewriting 300 small calc's.

Dan E

"Dan E" wrote in message ...
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




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default An Add-in question

Functions called from a worksheet can return values to the cell that contains
the formula. It can't punch values into other cells.

Maybe you could have the users run a macro (Sub) when they've finished entering
data.

Dan E wrote:

I guess I should mention that the problem is that you cannot
pass arguments to the spreadsheet from within the function.

The code always ends at:
AGA8_92C.Range("B2") = Press_PSIA

Any (and I mean ANY) ways around this (VB, C++, MATLAB)
anything that I could use without rewriting 300 small calc's.

Dan E

"Dan E" wrote in message ...
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



--

Dave Peterson

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2007 Macro/VB Question DDE Question MadDog22 Excel Worksheet Functions 1 March 10th 10 01:47 AM
where can I see my question and answer? Yesterday I ask a question IP Excel Discussion (Misc queries) 2 May 10th 08 04:08 PM
Newbie Question - Subtraction Formula Question [email protected] Excel Discussion (Misc queries) 3 May 5th 06 05:50 PM
The question is an excel question that I need to figure out howto do in excel. Terry Excel Worksheet Functions 3 January 23rd 06 06:22 PM
If/ then question Ellen Excel Programming 3 August 20th 03 02:06 PM


All times are GMT +1. The time now is 10:17 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"