Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Moving data validation input comments | Excel Discussion (Misc queries) | |||
How do I add input data in the input ranges in drop down boxes. | Excel Discussion (Misc queries) | |||
Moving ranges by start date | Excel Programming | |||
Solver and dynamic ranges | Excel Worksheet Functions | |||
moving ranges thru workbook | Excel Programming |