+ Reply to Thread
Results 1 to 5 of 5

Excel VBA - CountIf error

  1. #1
    Forum Contributor
    Join Date
    07-23-2012
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    211

    Excel VBA - CountIf error

    Hi all

    I have been racking my brain on my problem and have now decided to ask for help!

    I am trying to code CountIf using VBA. The code I have is:

    Please Login or Register  to view this content.
    The code gives an error 1004

    Can anyone advise what is wrong?

    Thanks

  2. #2
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Excel VBA - CountIf error

    It's just because you haven't fully qualified all your range with sheets. Try this:
    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    07-23-2012
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    211

    Re: Excel VBA - CountIf error

    Still not having any joy

    Maybe if I can elaborate on what I am trying to do, someone might come up with a solution?

    I have a sheet (Sheet1) which has base data. In columns 17 to 38, there is a value "y". I am trying to count the number of occurrences of "y" in each column and summarise the output in a second sheet (Analysis).

    As I said earlier, the code gives a Application defined or Object Defined error (1004)

    Thanks for any help

  4. #4
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Excel VBA - CountIf error

    Yours might, mine doesn't - have you tried it?

  5. #5
    Forum Contributor
    Join Date
    07-23-2012
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    211

    Re: Excel VBA - CountIf error

    Hello Stephen

    I think I was penning my message during your reply. Your solution worked!!

    Thanks very much.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Countif Error
    By Bobby82 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-18-2012, 07:44 AM
  2. CountIf Error
    By Tiffany08 in forum Excel General
    Replies: 2
    Last Post: 10-30-2011, 01:09 AM
  3. countif error?
    By lovi in forum Excel General
    Replies: 5
    Last Post: 09-13-2011, 05:41 PM
  4. countif error
    By mic_speedy in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-02-2010, 05:13 AM
  5. COUNTIF error w/ Excel 2003
    By mgarcia in forum Excel General
    Replies: 2
    Last Post: 06-03-2009, 01:58 AM

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