Hej alle,
Jeg står i den situation at mine macro'er ikke vil virke når jeg protecter mit sheet på nær 1. Jeg har i alt 5 macroer 2 engelsk 2 dansk som gør det samme, men excel kan ikke oversætte ordenligt og så 1 virkelig simpel print macro som virker. Håber i kan hjælpe, sig endelig til hvis i skal bruge arket, poster bare koden.
Sub PrintMultipleWorksheets()
'
'Prints TitlePage and PrintPage
'
Worksheets(Array("TitlePage", "PrintPage")).PrintOut
End Sub
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Sub PressureDrop_Parallel_eng()
'
' PressureDrop_Parallel_eng Macro
'
'
SolverReset
SolverOk SetCell:="$BN$4", MaxMinVal:=3, ValueOf:=0, ByChange:="$BL$4:$BL$7", _
Engine:=1, EngineDesc:="GRG Nonlinear"
SolverAdd CellRef:="$BN$5", Relation:=2, FormulaText:="0"
SolverOk SetCell:="$BN$4", MaxMinVal:=3, ValueOf:=0, ByChange:="$BL$4:$BL$7", _
Engine:=1, EngineDesc:="GRG Nonlinear"
SolverAdd CellRef:="$BN$6", Relation:=2, FormulaText:="0"
SolverAdd CellRef:="$BN$7", Relation:=2, FormulaText:="0"
SolverAdd CellRef:="$BN$8", Relation:=2, FormulaText:="0"
SolverAdd CellRef:="$BL$4", Relation:=1, FormulaText:="$BL$10"
SolverAdd CellRef:="$BL$4", Relation:=3, FormulaText:="$BL$11"
SolverAdd CellRef:="$BL$5", Relation:=1, FormulaText:="$BL$12"
SolverAdd CellRef:="$BL$5", Relation:=3, FormulaText:="$BL$13"
SolverAdd CellRef:="$BL$6", Relation:=1, FormulaText:="$BL$14"
SolverAdd CellRef:="$BL$6", Relation:=3, FormulaText:="$BL$15"
SolverAdd CellRef:="$BL$7", Relation:=1, FormulaText:="$BL$16"
SolverAdd CellRef:="$BL$7", Relation:=3, FormulaText:="$BL$17"
SolverOk SetCell:="$BN$4", MaxMinVal:=3, ValueOf:=0, ByChange:="$BL$4:$BL$7", _
Engine:=1, EngineDesc:="GRG Nonlinear"
SolverOk SetCell:="$BN$4", MaxMinVal:=3, ValueOf:=0, ByChange:="$BL$4:$BL$7", _
Engine:=1, EngineDesc:="GRG Nonlinear"
SolverSolve userFinish:=True
End Sub
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Sub PressureDrop_Parallel_dk()
'
' PressureDrop_Parallel_dk Makro
'
'
SolverReset
SolverAdd CellRef:="$BN$5", Relation:=2, FormulaText:="0"
SolverAdd CellRef:="$BN$6", Relation:=2, FormulaText:="0"
SolverAdd CellRef:="$BN$7", Relation:=2, FormulaText:="0"
SolverAdd CellRef:="$BN$8", Relation:=2, FormulaText:="0"
SolverAdd CellRef:="$BL$4", Relation:=1, FormulaText:="$BL$10"
SolverAdd CellRef:="$BL$4", Relation:=3, FormulaText:="$BL$11"
SolverAdd CellRef:="$BL$5", Relation:=1, FormulaText:="$BL$12"
SolverAdd CellRef:="$BL$5", Relation:=3, FormulaText:="$BL$13"
SolverAdd CellRef:="$BL$6", Relation:=1, FormulaText:="$BL$14"
SolverAdd CellRef:="$BL$6", Relation:=3, FormulaText:="$BL$15"
SolverAdd CellRef:="$BL$7", Relation:=1, FormulaText:="$BL$16"
SolverAdd CellRef:="$BL$7", Relation:=3, FormulaText:="$BL$17"
SolverOk SetCell:="$BN$4", MaxMinVal:=3, ValueOf:=0, ByChange:="$BL$4:$BL$7", _
Engine:=1, EngineDesc:="GRG ikke-lineær"
SolverSolve userFinish:=True
End Sub
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Sub PressureDrop_Loop_eng()
'
' PressureDrop_Loop_eng Macro
'
SolverReset
SolverOk SetCell:="$BX$17", MaxMinVal:=3, ValueOf:=0, ByChange:="$BX$21:$BX$23" _
, Engine:=1, EngineDesc:="GRG Nonlinear"
SolverAdd CellRef:="$BX$21", Relation:=1, FormulaText:="$BS$16"
SolverOk SetCell:="$BX$17", MaxMinVal:=3, ValueOf:=0, ByChange:="$BX$21:$BX$23" _
, Engine:=1, EngineDesc:="GRG Nonlinear"
SolverAdd CellRef:="$BX$21", Relation:=3, FormulaText:="$BS$17"
SolverAdd CellRef:="$BX$22", Relation:=1, FormulaText:="$BS$16"
SolverAdd CellRef:="$BX$22", Relation:=3, FormulaText:="$BS$17"
SolverAdd CellRef:="$BX$23", Relation:=1, FormulaText:="$BS$16"
SolverAdd CellRef:="$BX$23", Relation:=3, FormulaText:="$BS$17"
SolverOk SetCell:="$BX$17", MaxMinVal:=3, ValueOf:=0, ByChange:="$BX$21:$BX$23" _
, Engine:=1, EngineDesc:="GRG Nonlinear"
SolverOk SetCell:="$BX$17", MaxMinVal:=3, ValueOf:=0, ByChange:="$BX$21:$BX$23" _
, Engine:=1, EngineDesc:="GRG Nonlinear"
SolverSolve userFinish:=True
End Sub
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Sub PressureDrop_Loop_dk()
'
' PressureDrop_Loop_dk Makro
'
'
SolverReset
SolverAdd CellRef:="$BX$21", Relation:=1, FormulaText:="$BS$16"
SolverAdd CellRef:="$BX$21", Relation:=3, FormulaText:="$BS$17"
SolverAdd CellRef:="$BX$22", Relation:=1, FormulaText:="$BS$16"
SolverAdd CellRef:="$BX$22", Relation:=3, FormulaText:="$BS$17"
SolverAdd CellRef:="$BX$23", Relation:=1, FormulaText:="$BS$16"
SolverAdd CellRef:="$BX$23", Relation:=3, FormulaText:="$BS$17"
SolverOk SetCell:="$BX$17", MaxMinVal:=3, ValueOf:=0, ByChange:="$BX$21:$BX$23" _
, Engine:=1, EngineDesc:="GRG ikke-lineær"
SolverSolve userFinish:=True
End Sub