+ Reply to Thread
Results 1 to 6 of 6

VBA to add CountA formula style

  1. #1
    Forum Contributor
    Join Date
    10-29-2012
    Location
    Laos
    MS-Off Ver
    Excel 2003,2010,2013
    Posts
    126

    VBA to add CountA formula style

    Hi all friends and experts,

    I would like to ask your support,
    I have some data, need to add VBA COUNTA formula, by count row in column D
    also show CountA formula in the cell


    Screenshot 2022-05-21 143338.png
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Cool Hi, try this !


    According to your attachment a VBA demonstration as a beginner starter :

    PHP Code: 
    Sub Demo1()
        
    With Sheet1.UsedRange
            
    .Cells(.Rows.Count6).Formula "=COUNTA(" & .Columns(4).Address ")-1"
        
    End With
    End Sub 
    ► Do you like it ? ► So thanks to click on bottom left star icon « Add Reputation » !

  3. #3
    Forum Contributor
    Join Date
    10-29-2012
    Location
    Laos
    MS-Off Ver
    Excel 2003,2010,2013
    Posts
    126

    Re: Hi, try this !

    Hi Marc L
    thank you for your code,

    May I ask more, It's possible to add Total formula @ Column J with the same code?
    Last edited by yukioh; 05-25-2022 at 08:35 AM.

  4. #4
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Question Re: VBA to add CountA formula style


    Yes you can ! Just duplicate the codeline and update it, no difficulty …

    For more help if really necessary what is the formula you manually use ?
    Last edited by Marc L; 05-22-2022 at 05:17 AM.

  5. #5
    Forum Contributor
    Join Date
    10-29-2012
    Location
    Laos
    MS-Off Ver
    Excel 2003,2010,2013
    Posts
    126

    Re: VBA to add CountA formula style

    I use =Sum(xx:xx)
    Could you please help me on that...

  6. #6
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Lightbulb Try this …


    According to your attachment another beginner level VBA demonstration :

    PHP Code: 
    Sub Demo2()
        
    With Sheet1.Cells(Rows.Count1).End(xlUp).CurrentRegion.Rows
            
    .Cells(.Count6).Formula "=COUNTA(D" & .Row ":D" & .Row + .Count ")"
            
    .Cells(.Count12).Formula "=SUM(J" & .Row ":J" & .Row + .Count ")"
        
    End With
    End Sub 
    ► Do you like it ? ► So thanks to click on bottom left star icon « Add Reputation » !

+ 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. combining a counta(range) with a counta(single cell) statement?
    By Charles74 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 03-14-2022, 02:15 PM
  2. Copy to & apply style from another document - not all properties depend on style
    By kofeincek in forum Word Programming / VBA / Macros
    Replies: 1
    Last Post: 10-15-2020, 09:35 PM
  3. [SOLVED] need help with COUNTA formula
    By mikehk in forum Excel General
    Replies: 15
    Last Post: 02-09-2018, 07:35 AM
  4. [SOLVED] COUNTA Formula
    By fearonc in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 11-27-2017, 03:54 PM
  5. [SOLVED] Transform Data From Pivot Style to a Table Style
    By The_Snook in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-18-2016, 04:13 AM
  6. Normal Style to No Spacing Style by default.
    By dogberry in forum Word Formatting & General
    Replies: 1
    Last Post: 12-23-2012, 11:48 PM
  7. formula Counta
    By tangomj in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 03-07-2007, 05:45 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