Consulting

Results 1 to 3 of 3

Thread: Quick CountA question

  1. #1
    VBAX Newbie
    Joined
    Jan 2009
    Posts
    5
    Location

    Quick CountA question

    Hello -

    How would you write the code to set a variable (integer) to the number of rows that contain data/text in a sheet?

    I cant use specialcells/LastCell for various reasons. Has to be CountA or some other solution that I dont know of.

    Thanks!

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    [vba]

    myVar = Application.CountA(Columns("A"))
    [/vba]
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    VBAX Tutor
    Joined
    Dec 2008
    Posts
    244
    Location
    Counta will only count non blank cell, is it all data or just text data?

Posting Permissions

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