Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default Moving ranges as input for Solver

I have the following problem in Excel 2002:
I want a Solver makro to perform an optimisation over a range, which is
indirectly determined by the user input. This means: if the user states he is
35 years old, I want Solver to specify a calculation on a range which will
then be e.g. 65-35=30 columns wide, starting for instance from cell A2. Since
I can't tell Solver that cell A2+30 = cell AE2, what can I do instead to get
Solver to include the correct number of cells??

Any help would be greatly appreciated!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 64
Default Moving ranges as input for Solver

Assuming A2 = 65 (Retirement Age)
A3 = 35 (Variable Age)

This will Select the desired range. Maybe this
will be enough for you to complete the task.
Let me know if you need more help.

Sub Findit()
Dim rng As Range
x = Range("A2").Value
y = Range("A3").Value
With Cells
Range("A2").Activate
Set rng = .Range(.Cells(2, 1), .Cells(2, x - y + 1))
rng.Select
End With
End Sub

Best wishes,

Pops Jackson


"Kragelund" wrote:

I have the following problem in Excel 2002:
I want a Solver makro to perform an optimisation over a range, which is
indirectly determined by the user input. This means: if the user states he is
35 years old, I want Solver to specify a calculation on a range which will
then be e.g. 65-35=30 columns wide, starting for instance from cell A2. Since
I can't tell Solver that cell A2+30 = cell AE2, what can I do instead to get
Solver to include the correct number of cells??

Any help would be greatly appreciated!

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default Moving ranges as input for Solver

Wonderful, Pops, thanks for your help,

rgds

Henrik Kragelund

"Pops Jackson" skrev:

Assuming A2 = 65 (Retirement Age)
A3 = 35 (Variable Age)

This will Select the desired range. Maybe this
will be enough for you to complete the task.
Let me know if you need more help.

Sub Findit()
Dim rng As Range
x = Range("A2").Value
y = Range("A3").Value
With Cells
Range("A2").Activate
Set rng = .Range(.Cells(2, 1), .Cells(2, x - y + 1))
rng.Select
End With
End Sub

Best wishes,

Pops Jackson


"Kragelund" wrote:

I have the following problem in Excel 2002:
I want a Solver makro to perform an optimisation over a range, which is
indirectly determined by the user input. This means: if the user states he is
35 years old, I want Solver to specify a calculation on a range which will
then be e.g. 65-35=30 columns wide, starting for instance from cell A2. Since
I can't tell Solver that cell A2+30 = cell AE2, what can I do instead to get
Solver to include the correct number of cells??

Any help would be greatly appreciated!

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 64
Default Moving ranges as input for Solver

You are welcome. I am always happy to help.

Jim
--
Pops Jackson


"Kragelund" wrote:

Wonderful, Pops, thanks for your help,

rgds

Henrik Kragelund

"Pops Jackson" skrev:

Assuming A2 = 65 (Retirement Age)
A3 = 35 (Variable Age)

This will Select the desired range. Maybe this
will be enough for you to complete the task.
Let me know if you need more help.

Sub Findit()
Dim rng As Range
x = Range("A2").Value
y = Range("A3").Value
With Cells
Range("A2").Activate
Set rng = .Range(.Cells(2, 1), .Cells(2, x - y + 1))
rng.Select
End With
End Sub

Best wishes,

Pops Jackson


"Kragelund" wrote:

I have the following problem in Excel 2002:
I want a Solver makro to perform an optimisation over a range, which is
indirectly determined by the user input. This means: if the user states he is
35 years old, I want Solver to specify a calculation on a range which will
then be e.g. 65-35=30 columns wide, starting for instance from cell A2. Since
I can't tell Solver that cell A2+30 = cell AE2, what can I do instead to get
Solver to include the correct number of cells??

Any help would be greatly appreciated!

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
Moving data validation input comments Brad Excel Discussion (Misc queries) 1 January 21st 09 03:32 PM
How do I add input data in the input ranges in drop down boxes. oil_driller Excel Discussion (Misc queries) 1 November 9th 05 10:31 PM
Moving ranges by start date ashleyfox Excel Programming 0 August 22nd 05 11:19 PM
Solver and dynamic ranges tim Excel Worksheet Functions 0 May 5th 05 01:29 AM
moving ranges thru workbook Radomir Excel Programming 2 April 6th 04 12:26 AM


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

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

About Us

"It's about Microsoft Excel"