Number of Cells/Rows/Columns With Formula

A few weeks ago I received this question from someone called LS:

Hi
I want to write a macro that counts the following
- Number of cells with formula
- Number of Rows with formula
- Number of Columns with formula
Please let me know if there is a way of doing it in Excel VBA

To find out the number of cells, rows, or columns with formula in active Excel worksheet is quite simple.

In my previous post, we already have the Excel VBA code on how to select all cells with formula, so we only need to tweak this macro a little bit and get the results that we looking for.

Sub NumberOfCellsWFormula()

    'select all cells with formula
    Cells.SpecialCells(xlCellTypeFormulas).Select

    'number of cells with formula
    Debug.Print Selection.Count

    'number of rows with formula
    Debug.Print Selection.Rows.Count

    'number of columns with formula
    Debug.Print Selection.Columns.Count

End Sub

The Excel VBA procedure above will simply print the number of cells, rows, and columns of current active Excel Worksheet that containing any formula in it. Please be sure to run it from Excel VBA windows with Immediate Window turn on (View ยป Immediate Window or CTRL+G).

In short, we only need to use Range properties Count, Rows.Count, and Columns.Count to get the number of selected cells, rows or columns.

FIN.

This entry was posted in Cells and Range, Workbook and Worksheet and tagged , , , , , , , , , , . Bookmark the permalink.

1,641 Responses to Number of Cells/Rows/Columns With Formula

  1. Pingback: apr mean

  2. Pingback: movers

  3. Pingback: target marketing

  4. Pingback: Dining Room Furniture

  5. Pingback: beats studio

  6. Pingback: carpet runners for stairs

  7. Pingback: ordenadores

  8. Pingback: cliquez ici

  9. Pingback: the safe cig

  10. Pingback: klonopin

  11. Pingback: how to treat asthma

  12. Pingback: Legal Forum

  13. Pingback: Ecommerce

  14. Pingback: click

  15. Pingback: live betting

  16. Pingback: become a beach body coach

  17. Pingback: Blitz Media Marketing

  18. Pingback: pay per click

  19. Pingback: prescription eye glasses with colored frames

  20. Pingback: check it out

  21. Pingback: femme en webcam

  22. Pingback: internet online business

  23. Pingback: laser hair removal at home

  24. Pingback: mbts

  25. Pingback: Server 2003 Activation Key

  26. Pingback: fashion boutique game

  27. Pingback: best universities

  28. Pingback: create your own website

  29. Pingback: research insurance in tucson

  30. Pingback: clicky

  31. Pingback: instant loans

  32. Pingback: gogo games

  33. Pingback: remove frames

  34. Pingback: here

  35. Pingback: Symbol LS 4278 Barcode Scanner

  36. Pingback: network monitoring tools

  37. Pingback: servis char

  38. Pingback: learn about mortgage life insurance

  39. Pingback: promoting and celebrating Virginia creativity

  40. Pingback: click for accountant for contractors

  41. Pingback: commercial 30 day payday loan

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>