Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Dana
It will give you all empty cells in the column. If the OP want that I don't know? If I use 100 rows of data and want to know how many are empty then I don't want a answer of 65436 or more. -- Regards Ron de Bruin http://www.rondebruin.nl "Dana DeLouis" wrote in message ... Hello. Would this idea work? Set Rng = Columns("A:A") 'Your Range here With WorksheetFunction Stuff = .CountA(Rng) Blanks = .CountBlank(Rng) End With Dana DeLouis "Ron de Bruin" wrote in message ... Hi Dana Maybe the OP have a other reason to use the range But it is easy to get the blanks now count = rng.Cells.count - Application.WorksheetFunction.CountA(rng) MsgBox count -- Regards Ron de Bruin http://www.rondebruin.nl "Dana DeLouis" wrote in message ... Set rng = Range(Cells(1, 1), Cells(Rows.count, 1).End(xlUp)) count = Application.WorksheetFunction.CountA(rng) I may have misunderstood the question, but I think this returns the same number. col = 1 count = WorksheetFunction.CountA(Columns(col)) HTH Dana DeLouis "Jako " wrote in message ... I am using this code to count the number of cells in column A that are NOT empty. '------------------------------------------------------------- Sub RowACount() Dim rng As Range Dim count As Long Set rng = Range(Cells(1, 1), Cells(Rows.count, 1).End(xlUp)) count = Application.WorksheetFunction.CountA(rng) MsgBox count End Sub '------------------------------------------------------------ Which works great!! What i want to then do is... Count the number of cells in column C, (but i'm not sure how to change the code to do this), and name the Subroutine as RowCCount() Also I want to count the number of Empty cells in columm A and name the Subroutine it Sub EmptyCellCount() Many thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Help with changing code | Excel Discussion (Misc queries) | |||
changing zip code to number | Excel Discussion (Misc queries) | |||
changing format code?? please help!!! | Excel Discussion (Misc queries) | |||
code for changing font | Excel Discussion (Misc queries) | |||
Changing code with code | Excel Programming |