+ Reply to Thread
Results 1 to 5 of 5

count formula

Hybrid View

uttam.mothe count formula 08-26-2014, 02:47 AM
Pepe Le Mokko Re: count formula 08-26-2014, 03:36 AM
uttam.mothe Re: count formula 08-26-2014, 05:13 AM
JOHN H. DAVIS Re: count formula 08-26-2014, 06:27 AM
kalak Re: count formula 08-26-2014, 06:42 AM
  1. #1
    Registered User
    Join Date
    08-31-2013
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    51

    count formula

    Hi All,

    I would like to write a formula by using vba code

    sheet1 A column i have data, row is not constant it will change

    i would like to count the A column data

    Ex:
    A
    10
    20
    30
    --
    --

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2504
    Posts
    13,654

    Re: count formula

    Perhaps the COUNTA function ?

  3. #3
    Registered User
    Join Date
    08-31-2013
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    51

    Re: count formula

    ye, but i need the formula in vba code

  4. #4
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: count formula

    Does this help?

    Sub uttam_mothezz()
    Range("A" & Rows.count).End(3)(2).Formula = "=SUM(A2:A" & Range("A" & Rows.count).End(3).Row & ")"
    End Sub

  5. #5
    Valued Forum Contributor
    Join Date
    03-21-2013
    Location
    cyberia
    MS-Off Ver
    Excel 2007
    Posts
    457

    Re: count formula

    maybe like this? (assumes your data are of same datatype as you posted)
    Sub cccc()
    Const n& = 10 ^ 5
    Dim b&(n), c
    
    For Each c In Cells(1).Resize(Cells(Rows.count, 1).End(xlUp).Row).Value
        If Len(c) > 0 Then b(c) = b(c) + 1
    Next c
    
    For Each c In Cells(1).Resize(Cells(Rows.count, 1).End(xlUp).Row)
        If b(c) > 0 Then c.Offset(, 1) = b(c)
    Next c
    
    End Sub

+ 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] Count formula not count hidden cells in table
    By tlacloche in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-06-2013, 02:35 PM
  2. [SOLVED] Count and average formula needed to not count text field
    By excelteam777 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-07-2013, 05:30 PM
  3. [SOLVED] text count issue, it seems to count the formula also?
    By randypang in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-28-2013, 03:27 AM
  4. Replies: 5
    Last Post: 08-29-2012, 05:25 PM
  5. Count Formula-Would this be a good example to use the count function?
    By JK1234 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 08-01-2008, 02:44 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