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.
Isn’t it strange that this works:
Cells.SpecialCells(xlCellTypeFormulas).Select
Selection.Count
but this doesn’t?
Cells.SpecialCells(xlCellTypeFormulas).Count
I have in my spreadsheet rows different records of golf scores of many golfers arranged with date chronologically. I transpose want to transpose & count only last twenty rounds for handicap calculations.How do I do it. I know how to transpose , but i do not know how to use only the last 20 rounds and ignore the previous scores. (example: tom has 37 rounds of golf. I want to count only 18-37 and not use 1-17.
Pingback: Tummy Tuck Pictures
Pingback: URL
Pingback: how to get rid of acne scars
Pingback: cheap weekend breaks
Pingback: geburtstagskarten
Pingback: Hotels in Assen
Pingback: debt consolidation companies
Pingback: reverse mortgages
Pingback: debt management companies
Pingback: reverse mortgage problems
Pingback: bahamas real estate rentals
Pingback: vimax brasil
Pingback: Berufsunfähigkeitsversicherung
Pingback: boxfresh for men
Pingback: sofas
Pingback: conveyancing
Pingback: campervan hire
Pingback: easter revision courses
Pingback: fancy dress costumes
Pingback: golf swing tips
Pingback: plane parking games
Pingback: open office
Pingback: cybercrime expert
Pingback: basement odors
Pingback: Kindle Ebook Reader Test
Pingback: persoonlijke lening
Pingback: how to find a job in America
Pingback: best iphone apps for kids
Pingback: Fencing Installers North London
Pingback: Fencing Installers North London
Pingback: Landscape Gardeners London
Pingback: magic of making up
Pingback: buy cake pops
Pingback: Ares Free Download
Pingback: chamomile tea benefits
Pingback: best buy coupon code
Pingback: amazon coupon
Pingback: Alternative Energy Projects
Pingback: tax relief
Pingback: san diego bankruptcy attorney
Pingback: fiance visa
Pingback: mas 200
Pingback: carlsbad bankruptcy lawyer
Pingback: black mold
Pingback: Moulinex fresh express
Pingback: Tour Scooter 2012/2013
Pingback: Hochdruckreiniger Test
Pingback: i gun app