+ Reply to Thread
Results 1 to 10 of 10

Why dynamic range doesnt work with COUNTA

  1. #1
    Registered User
    Join Date
    07-31-2013
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    5

    Why dynamic range doesnt work with COUNTA

    WorksheetFunction.CountA(Worksheets("Data_Rough").Range(Range("C4"), Range("C4").End(xlDown))) ................it gives application defined/object defined error. Can anybody explain?

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,482

    Re: Why dynamic range doesnt work with COUNTA

    Try fully qualifying all the range references

    Please Login or Register  to view this content.
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    07-31-2013
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Why dynamic range doesnt work with COUNTA

    Actually what should I do if I write a code in the sheet rather than this workbook or modules and want to select a dynamic range from another worksheet?

  4. #4
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,482

    Re: Why dynamic range doesnt work with COUNTA

    when you say 'write code in sheet' do you mean the Sheet object or acutally in a cell as a formula?

  5. #5
    Registered User
    Join Date
    07-31-2013
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Why dynamic range doesnt work with COUNTA

    Sheet Object

  6. #6
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,482

    Re: Why dynamic range doesnt work with COUNTA

    Apart from the result not actually being stored anywhere that code should work.

    Perhaps you should post workbook example detailing what you have used and what exactly you are trying to do

  7. #7
    Registered User
    Join Date
    07-31-2013
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Why dynamic range doesnt work with COUNTA

    Picture1.jpg
    Here, I want to count the number of non blank cells within a range (which i want to select dynamically) in worksheet Data_Rough when the code is written in worksheet Data

  8. #8
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,482

    Re: Why dynamic range doesnt work with COUNTA

    that's a picture, I asked for a "workbook example"

    and you have not explained how that code should be used? where should the result of the COUNTA go?

  9. #9
    Registered User
    Join Date
    07-31-2013
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Why dynamic range doesnt work with COUNTA

    I just want the answer in a MSGBOX

  10. #10
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,482

    Re: Why dynamic range doesnt work with COUNTA

    Please Login or Register  to view this content.
    I'm still non the wiser about how this should actually work but above will display information in msgbox

+ 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] Select range doesnt work
    By timtim89 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-16-2012, 11:09 AM
  2. Dynamic Range doesnt extend pasted data?
    By Armitage2k in forum Excel General
    Replies: 12
    Last Post: 05-02-2012, 09:11 AM
  3. Range(Range1) Variable doesnt work. _Global error
    By prefix in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-31-2011, 10:35 AM
  4. sort doesnt work with Range of cells
    By xfusr in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-20-2007, 02:39 PM
  5. CountA - Dynamic Range - Macro
    By elcentro3m in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 09-10-2007, 02:54 PM

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