Formula is missing something (according to code anyway)

rogernz

Board Regular
Joined
Jul 21, 2004
Messages
93
My code is below, I recorded most of it, and edited it to suit, now when I go to run the code is says it is missing a sub or function when it gets to the solver part of the code - umm, some help please, I imagine I am missing a small piece of code at the beginning of this part of the code - but no idea what.

Thanks in advance


Sub Skin_detail()
' macro to display skin requirements
Sheets("CHASSIS STRESS").Select
Application.Run "'TSV CHASSIS STRESS CALCULATOR (V5.3 - TRUCK SELECT).xls'!FRONT"
ActiveSheet.Unprotect
Range("D33") = "=zrangemain"
Range("D34") = "=zrangemain"
SolverOk SetCell:="$H$33", MaxMinVal:=3, ValueOf:="130.66", ByChange:="user1"
SolverAdd CellRef:="user1", Relation:=1, FormulaText:="$B$29"
SolverAdd CellRef:="user1", Relation:=3, FormulaText:="0"
SolverSolve
Range("C84") = "=user1"
'front max start requirement set, now calculate front max end requirement
SolverOk SetCell:="$H$34", MaxMinVal:=3, ValueOf:="130.66", ByChange:="user2"
SolverAdd CellRef:="user2", Relation:=1, FormulaText:="$B$30"
SolverAdd CellRef:="user2", Relation:=3, FormulaText:="$B$29"
SolverSolve
Range("D84") = "=user2"
Range("C84:D84").Copy
Range("C84").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
'front max end requirement set, now change to rear max
Sheets("CHASSIS STRESS").Select
Application.Run "'TSV CHASSIS STRESS CALCULATOR (V5.3 - TRUCK SELECT).xls'!rear"
ActiveSheet.Unprotect
SolverOk SetCell:="$H$33", MaxMinVal:=3, ValueOf:="130.66", ByChange:="user1"
SolverAdd CellRef:="user1", Relation:=1, FormulaText:="$B$29"
SolverAdd CellRef:="user1", Relation:=3, FormulaText:="0"
SolverSolve
Range("C85") = "=user1"
'rear max start requirement set, now calculate rear max end requirement
SolverOk SetCell:="$H$34", MaxMinVal:=3, ValueOf:="130.66", ByChange:="user2"
SolverAdd CellRef:="user2", Relation:=1, FormulaText:="$B$30"
SolverAdd CellRef:="user2", Relation:=3, FormulaText:="$B$29"
SolverSolve
Range("D85") = "=user2"
Range("C85:D85").Copy
Range("C85").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
'both limits now set, now add vertical bars to graph to display results...
End Sub
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
tried referencing the solver from the tools menu and it said internal error! Might try a looping function to solve instead - This works great, but if it is going to cause a nightmare in programming then it is more trouble than its worth.
 
Upvote 0

Forum statistics

Threads
1,214,946
Messages
6,122,401
Members
449,081
Latest member
JAMES KECULAH

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top