I have a multiple sheet Excel sheet and i've included a calendar function to easily change the date of birth using this Explicit option on sheet 6
(Codes on sheet 6)
Option Explicit
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim isect As Range
If Target.Cells.Count > 1 Then Exit Sub
Set isect = Intersect(Target, Range("$E$3,$E$5,$G$3:$G$5"))
If Not isect Is Nothing Then
frmCalendar.Show_Cal
End If
End Sub
When I try to use the solver (with VBA code) on this sheet, i receive this error
Method Range of object worksheet failed
If I use the solver on any other sheets, it runs well
In Module 1 the codes for the solver is
(Button in sheet 6 calling macro in module 1)
Sub OptimisingPay()
'
'
SolverReset
SolverOk SetCell:="$w$4", MaxMinVal:=3, ValueOf:="0", ByChange:="$w$3"
SolverSolve UserFinish:=True
SolverReset
SolverOk SetCell:="$x$4", MaxMinVal:=3, ValueOf:="0", ByChange:="$x$3"
SolverSolve UserFinish:=True
SolverReset
Range("M23").Value = Range("W3")
Range("N23").Value = Range("X3")
End Sub
Is there a way to correct this?
Many thanks
Bookmarks