Hi Xl'ers!
I have a workbook with 2 sheets named "Frontpage" and "Data".
In the sheet "Frontpage" I have a button that runs a macro with a solver where all the inputs are placed in the sheet "Data" (The sheet data is hided for the user). I have named all the inputs in the namebox.
My problem is that I can only run the macro from the sheet "Data" and not from "Frontpage". Of course I can just unhide and select the sheet "Data" when the macro performs, and then return to "Frontpage", but is there any other solution???
Kind regards;
ShvDk
The macro is:
Sheets("Data").Visible=True
Sheets("Data").Select
Range("BV81").Select
Range("str1_cellref1").Value = 0
SolverReset
SolverAdd CellRef:="str1_cellref1", Relation:=3, FormulaText:="str1_cons1"
SolverOk SetCell:="str1_setcell1", MaxMinVal:=3, ValueOf:="0", ByChange:="str1_cellref1"
SolverSolve Userfinish:=True
SolverFinish Keepfinal:=1
Sheets("Data").Visible=False
Sheets("Frontpage").Select
Range("B33").Select
I have a workbook with 2 sheets named "Frontpage" and "Data".
In the sheet "Frontpage" I have a button that runs a macro with a solver where all the inputs are placed in the sheet "Data" (The sheet data is hided for the user). I have named all the inputs in the namebox.
My problem is that I can only run the macro from the sheet "Data" and not from "Frontpage". Of course I can just unhide and select the sheet "Data" when the macro performs, and then return to "Frontpage", but is there any other solution???
Kind regards;
ShvDk
The macro is:
Sheets("Data").Visible=True
Sheets("Data").Select
Range("BV81").Select
Range("str1_cellref1").Value = 0
SolverReset
SolverAdd CellRef:="str1_cellref1", Relation:=3, FormulaText:="str1_cons1"
SolverOk SetCell:="str1_setcell1", MaxMinVal:=3, ValueOf:="0", ByChange:="str1_cellref1"
SolverSolve Userfinish:=True
SolverFinish Keepfinal:=1
Sheets("Data").Visible=False
Sheets("Frontpage").Select
Range("B33").Select