bloodybrit90
Board Regular
- Joined
- Jul 18, 2011
- Messages
- 111
Hey,
the below code uses Solver determine to determine what a number needs to be in order to make 20%. It works well, however after the macro run I need it to round to the nearest whole number then convert it to end in 990.
Example.
From 154,859.054548
To 154,990
Sub MultiSolve()
Application.DisplayAlerts = False
Application.ScreenUpdating = False
Set MyTestRange = Range("C5")
For cp = 0 To 8 'gives column offsets C to K
If MyTestRange.Offset(0, cp).Value >= 0 Then
MySet = MyTestRange.Offset(53, cp).Address
MyChange = MyTestRange.Offset(11, cp).Address
MyVal = "0.2"
SolverOk SetCell:=MySet, MaxMinVal:=3, ValueOf:=MyVal, ByChange:=MyChange
SolverSolve UserFinish:=True
End If
Next cp
Application.DisplayAlerts = True
Application.ScreenUpdating = False
End Sub
Any ideas?
the below code uses Solver determine to determine what a number needs to be in order to make 20%. It works well, however after the macro run I need it to round to the nearest whole number then convert it to end in 990.
Example.
From 154,859.054548
To 154,990
Sub MultiSolve()
Application.DisplayAlerts = False
Application.ScreenUpdating = False
Set MyTestRange = Range("C5")
For cp = 0 To 8 'gives column offsets C to K
If MyTestRange.Offset(0, cp).Value >= 0 Then
MySet = MyTestRange.Offset(53, cp).Address
MyChange = MyTestRange.Offset(11, cp).Address
MyVal = "0.2"
SolverOk SetCell:=MySet, MaxMinVal:=3, ValueOf:=MyVal, ByChange:=MyChange
SolverSolve UserFinish:=True
End If
Next cp
Application.DisplayAlerts = True
Application.ScreenUpdating = False
End Sub
Any ideas?