Thema Datum  Von Nutzer Rating
Antwort
03.10.2020 12:53:05 Christine
NotSolved
03.10.2020 13:14:45 Gast61955
NotSolved
Rot Solver - VBA Performance sehr schwach
03.10.2020 13:28:06 Gast25805
NotSolved
03.10.2020 14:15:10 Gast61955
NotSolved

Ansicht des Beitrags:
Von:
Gast25805
Datum:
03.10.2020 13:28:06
Views:
556
Rating: Antwort:
  Ja
Thema:
Solver - VBA Performance sehr schwach
 Moin,
 
so sollte es schneller laufen.
 
 
Sub Solver_Unsecurity_Basis()
 
 
 
Dim i As Integer
ActiveWorkbook.ActiveSheet.Activate
 
Application.screenupdate = False
Application.DisplayAlerts = False
Application.Calculation = xlCalculationManual
   Application.EnableEvents = False
 
 
 
For i = 10325 To 10326
SolverReset
SolverOk SetCell:="$AW$" & i, MaxMinVal:=1, ValueOf:=0, ByChange:="$C$" & i & ",$D$" & i & ",$E$" & i & ",$F$" & i & ",$G$" & i & ",$H$" & i & ",$I$" & i & ",$J$" & i & ",$K$" & i & ",$L$" & i & ",$M$" & i & ",$N$" & i & ",$O$" & i & ",$P$" & i & ",$Q$" & i & ",$R$" & i & ",$S$" & i & ",$T$" & i & ",$U$" & i & ",$V$" & i & ",$W$" & i & ",$X$" & i, Engine:=2, EngineDesc:="Simplex LP"  'hier prüfen, ob "ByChange" die gewünschten Spalten erkennt...
 
    SolverAdd CellRef:="$BU$" & i, Relation:=1, FormulaText:="$BW$" & i
    SolverAdd CellRef:="$CU$" & i, Relation:=1, FormulaText:="$CW$" & i
    SolverAdd CellRef:="$DU$" & i, Relation:=1, FormulaText:="$DW$" & i
    SolverAdd CellRef:="$EU$" & i, Relation:=1, FormulaText:="$EW$" & i
    SolverAdd CellRef:="$FU$" & i, Relation:=1, FormulaText:="$FW$" & i
    SolverAdd CellRef:="$GU$" & i, Relation:=1, FormulaText:="$GW$" & i
    SolverAdd CellRef:="$HU$" & i, Relation:=1, FormulaText:="$HW$" & i
    SolverAdd CellRef:="$IU$" & i, Relation:=1, FormulaText:="$IW$" & i
    SolverAdd CellRef:="$JU$" & i, Relation:=1, FormulaText:="$JW$" & i
    SolverAdd CellRef:="$KU$" & i, Relation:=1, FormulaText:="$KW$" & i
    SolverAdd CellRef:="$LU$" & i, Relation:=1, FormulaText:="$LW$" & i
    SolverAdd CellRef:="$MU$" & i, Relation:=1, FormulaText:="$MW$" & i
    SolverAdd CellRef:="$NU$" & i, Relation:=1, FormulaText:="$NW$" & i
    SolverAdd CellRef:="$OU$" & i, Relation:=1, FormulaText:="$OW$" & i
    SolverAdd CellRef:="$PU$" & i, Relation:=1, FormulaText:="$PW$" & i
    SolverAdd CellRef:="$QU$" & i, Relation:=1, FormulaText:="$QW$" & i
    SolverAdd CellRef:="$RU$" & i, Relation:=1, FormulaText:="$RW$" & i
    SolverAdd CellRef:="$SU$" & i, Relation:=1, FormulaText:="$SW$" & i
    SolverAdd CellRef:="$TU$" & i, Relation:=1, FormulaText:="$TW$" & i
    SolverAdd CellRef:="$UU$" & i, Relation:=1, FormulaText:="$UW$" & i
    SolverAdd CellRef:="$VU$" & i, Relation:=1, FormulaText:="$VW$" & i
    SolverAdd CellRef:="$WU$" & i, Relation:=1, FormulaText:="$WW$" & i
 
SolverSolve True
Next i
Application.Calculate
Application.Calculation = xlCalculationAutomatic
Application.screenupdate = True
Application.DisplayAlerts = True
End Sub
 
 

Ihre Antwort
  • Bitte beschreiben Sie Ihr Problem möglichst ausführlich. (Wichtige Info z.B.: Office Version, Betriebssystem, Wo genau kommen Sie nicht weiter)
  • Bitte helfen Sie ebenfalls wenn Ihnen geholfen werden konnte und markieren Sie Ihre Anfrage als erledigt (Klick auf Häckchen)
  • Bei Crossposting, entsprechende Links auf andere Forenbeiträge beifügen / nachtragen
  • Codeschnipsel am besten über den Code-Button im Text-Editor einfügen
  • Die Angabe der Emailadresse ist freiwillig und wird nur verwendet, um Sie bei Antworten auf Ihren Beitrag zu benachrichtigen
Thema: Name: Email:



  • Bitte beschreiben Sie Ihr Problem möglichst ausführlich. (Wichtige Info z.B.: Office Version, Betriebssystem, Wo genau kommen Sie nicht weiter)
  • Bitte helfen Sie ebenfalls wenn Ihnen geholfen werden konnte und markieren Sie Ihre Anfrage als erledigt (Klick auf Häckchen)
  • Bei Crossposting, entsprechende Links auf andere Forenbeiträge beifügen / nachtragen
  • Codeschnipsel am besten über den Code-Button im Text-Editor einfügen
  • Die Angabe der Emailadresse ist freiwillig und wird nur verwendet, um Sie bei Antworten auf Ihren Beitrag zu benachrichtigen

Thema Datum  Von Nutzer Rating
Antwort
03.10.2020 12:53:05 Christine
NotSolved
03.10.2020 13:14:45 Gast61955
NotSolved
Rot Solver - VBA Performance sehr schwach
03.10.2020 13:28:06 Gast25805
NotSolved
03.10.2020 14:15:10 Gast61955
NotSolved