Results 1 to 3 of 3

Method Range of object worksheet failed

Threaded View

Jean Gabriel 10 Method Range of object... 10-06-2012, 02:21 PM
Alf Re: Method Range of object... 10-07-2012, 11:26 AM
Jean Gabriel 10 Re: Method Range of object... 10-08-2012, 12:03 PM
  1. #1
    Registered User
    Join Date
    09-19-2012
    Location
    Asbestos
    MS-Off Ver
    Excel 2007
    Posts
    2

    Method Range of object worksheet failed

    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
    Last edited by Leith Ross; 10-07-2012 at 01:34 PM. Reason: Added Code Tags

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1