I am trying to use solver to find what time it takes for the value with no failures to be the same as the value with. there are a total of about 100 different individual components and i wish to test each individually.
i have written a macro to run solver for me and this works fine,
Sub failure_solver()
'
' equasl1 Macro
'
'
ActiveCell.Select
ActiveCell.FormulaR1C1 = "=1"
SolverOk SetCell:="$A$2", MaxMinVal:=3, ValueOf:=0.00236640826729541, ByChange:= _
"$F$40", Engine:=1, EngineDesc:="GRG Nonlinear"
SolverSolve userfinish:=True
SolverFinish (KeepFinal)
End Sub
however after running this i want to record to output value of the solver in another cell adjacent to the failed cell. so i have been using this macro ;
Sub copyandpaste()
'
' copyandpaste Macro
'
'
ActiveCell.Offset(0, 4).Range("A1").Select
Selection.copy
ActiveCell.Offset(0, 1).Range("A1").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
End Sub
which also works fine when run on its own.
however as there are so many variable i want to combine the two macros to run the solver, then copy and paste the value. i have been trying this:
Sub Run_All_Macros()
Call failure_solver
Call copyandpaste
End Sub
but i cannot get the copy and paste to happen after solver has finished calculating.
please help me solve this, i have spent hours trying to work it out already. Thanks.
Moderator Note:
Pls use code tags around your code next time as per forum rules.
Bookmarks