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.
Pingback: apr mean
Pingback: movers
Pingback: target marketing
Pingback: Dining Room Furniture
Pingback: beats studio
Pingback: carpet runners for stairs
Pingback: ordenadores
Pingback: cliquez ici
Pingback: the safe cig
Pingback: klonopin
Pingback: how to treat asthma
Pingback: Legal Forum
Pingback: Ecommerce
Pingback: click
Pingback: live betting
Pingback: become a beach body coach
Pingback: Blitz Media Marketing
Pingback: pay per click
Pingback: prescription eye glasses with colored frames
Pingback: check it out
Pingback: femme en webcam
Pingback: internet online business
Pingback: laser hair removal at home
Pingback: mbts
Pingback: Server 2003 Activation Key
Pingback: fashion boutique game
Pingback: best universities
Pingback: create your own website
Pingback: research insurance in tucson
Pingback: clicky
Pingback: instant loans
Pingback: gogo games
Pingback: remove frames
Pingback: here
Pingback: Symbol LS 4278 Barcode Scanner
Pingback: network monitoring tools
Pingback: servis char
Pingback: learn about mortgage life insurance
Pingback: promoting and celebrating Virginia creativity
Pingback: click for accountant for contractors
Pingback: commercial 30 day payday loan