Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
tom tom is offline
external usenet poster
 
Posts: 570
Default Using Solver in VBA for excel without cell references

Hi!

I want to create a function that does the following
1. Is a function
2. gets data from external datasources
3. does calculations
4. optimizes using the solver (minimize the square sum of errors of a formula)
5. returns the value (as a normal function)

All this is straightforward, however, I would like not to use cell
references and
use variables directly in the VBA code instead of i.e. creating a new
spreadhseet,
inserting the values, running the solver from vba, reading the result and
deleting the
worksheet, and then returning the result. In other words I would like to run
the solver internally in the code without using cells in Excel.

I hope this was somewhat clear, since I'm not a programmer. All other steps
than the solver in my code is relatively easy, but I don't seem to be able to
put my mind as to how the solver should work without cell references (using
variables instead).

Does anyone have a suggestion?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Using Solver in VBA for excel without cell references

On Jun 13, 5:11 am, Tom wrote:
Hi!

I want to create a function that does the following
1. Is a function
2. gets data from external datasources
3. does calculations
4. optimizes using the solver (minimize the square sum of errors of a formula)
5. returns the value (as a normal function)

All this is straightforward, however, I would like not to use cell
references and
use variables directly in the VBA code instead of i.e. creating a new
spreadhseet,
inserting the values, running the solver from vba, reading the result and
deleting the
worksheet, and then returning the result. In other words I would like to run
the solver internally in the code without using cells in Excel.

I hope this was somewhat clear, since I'm not a programmer. All other steps
than the solver in my code is relatively easy, but I don't seem to be able to
put my mind as to how the solver should work without cell references (using
variables instead).

Does anyone have a suggestion?


You can't, because Frontline formulations are dependent on Excel range
equations/inequalities. You can do what you are suggesting in VBA,
but you have to place the data in cells and then you also have to call
the Solver from your function. Which I guess would be the return
value. The Frontline solver has a set VBA functions you can access by
referencing its Library in your project. You use those to manage the
model.

If you don't know VBA, you are either outta luck unless you hire
someone help you or you do become a programmer soon.

SteveM
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
convert relative cell references to absolute cell references via amacro? Dave F[_2_] Excel Discussion (Misc queries) 1 May 15th 08 04:43 PM
How to rename references from range names to cell references Abbas Excel Discussion (Misc queries) 1 May 24th 06 06:18 PM
Multiple or Variable cell references in Solver (Excel 97) Coreyhotlin Excel Worksheet Functions 1 February 14th 06 01:36 PM
How do I enter cell references in "Equal to" box in solver jhelp Excel Worksheet Functions 3 September 19th 05 03:57 PM
how to use relative cell references with solver you Excel Programming 1 December 31st 04 01:43 AM


All times are GMT +1. The time now is 07:24 PM.

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"