+ Reply to Thread
Results 1 to 4 of 4

Error Using WorksheetFunction.SumIf

  1. #1
    Registered User
    Join Date
    08-01-2012
    Location
    Montgomery, AL
    MS-Off Ver
    Excel 2007
    Posts
    2

    Error Using WorksheetFunction.SumIf

    I have some Code that does a number of things but currently I am looking to get the value of a SumIf into a cell on my worksheet. My Data is on the 'CheckerSheet' and the criteria I am matching is on the 'DiscrepancySheet'. The sheets are in separate workbooks and both workbooks are open.

    Please Login or Register  to view this content.
    I am getting a 1004 error Method 'Range' of Object '_Worksheet' failed. Debugging points me to the first line of the For statement. Replacing '.Cells(i, 2)' with a string that matches one of the options gets it to work so I know the problem is there but I cant seem to figure it out. I have tried the following options

    Please Login or Register  to view this content.
    I know this probably going to be a simple fix and I am going to feel like an idiot but it's stumping me right now.

    Thanks in advance for the assist!!

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

    Re: Error Using WorksheetFunction.SumIf

    Try this.
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  3. #3
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,653

    Re: Error Using WorksheetFunction.SumIf

    Try this...

    WorksheetFunction.SumIf(Range(CheckerSheet.Cells(7, 3), CheckerSheet.Cells(CheckerMaxRow, 3)), ...

  4. #4
    Registered User
    Join Date
    08-01-2012
    Location
    Montgomery, AL
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Error Using WorksheetFunction.SumIf

    Worked like a charm. Thank you both so much.

    I confused myself by getting it to work with the static value in there but in copying the static value I was leaving the 'CheckerSheet' active and avoiding the Range error.

+ Reply to Thread

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