Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Count contents in a column
I need to return the number of cells that contain values in a column. I've played with Selection.EntireColumn Select & Selection.Columns.Count but these just return the number of columns I have selected versus the number of values in those columns. I'm looking for the VBA code that does the spreadsheet formula "=counta(D:D)", which returns the number of values in the column "D". I don't need the values themselves, just an indication if there are any values in the first place. Thanks, -- JWM6 ------------------------------------------------------------------------ JWM6's Profile: http://www.excelforum.com/member.php...o&userid=33413 View this thread: http://www.excelforum.com/showthread...hreadid=534361 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Count contents in a column
msgbox application.counta(worksheets("sheet1").range("d:d "))
is one way. JWM6 wrote: I need to return the number of cells that contain values in a column. I've played with Selection.EntireColumn Select & Selection.Columns.Count but these just return the number of columns I have selected versus the number of values in those columns. I'm looking for the VBA code that does the spreadsheet formula "=counta(D:D)", which returns the number of values in the column "D". I don't need the values themselves, just an indication if there are any values in the first place. Thanks, -- JWM6 ------------------------------------------------------------------------ JWM6's Profile: http://www.excelforum.com/member.php...o&userid=33413 View this thread: http://www.excelforum.com/showthread...hreadid=534361 -- Dave Peterson |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Count contents in a column
This will count all of the populated cells in column A
MsgBox Application.WorksheetFunction.CountA(Columns("A")) -- HTH... Jim Thomlinson "JWM6" wrote: I need to return the number of cells that contain values in a column. I've played with Selection.EntireColumn Select & Selection.Columns.Count but these just return the number of columns I have selected versus the number of values in those columns. I'm looking for the VBA code that does the spreadsheet formula "=counta(D:D)", which returns the number of values in the column "D". I don't need the values themselves, just an indication if there are any values in the first place. Thanks, -- JWM6 ------------------------------------------------------------------------ JWM6's Profile: http://www.excelforum.com/member.php...o&userid=33413 View this thread: http://www.excelforum.com/showthread...hreadid=534361 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Count contents in a column
Seems simple enough to me and I was looking at something more complicated... ThanKs! -- JWM6 ------------------------------------------------------------------------ JWM6's Profile: http://www.excelforum.com/member.php...o&userid=33413 View this thread: http://www.excelforum.com/showthread...hreadid=534361 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Fill a column with the contents of another column based on a choic | Excel Discussion (Misc queries) | |||
how to copy contents of one column to another column in another worksheet | Excel Discussion (Misc queries) | |||
move contents of column C based on criteria related to column A | Excel Discussion (Misc queries) | |||
Count Intervals of Filtered TEXT values in Column and Return Count across a Row | Excel Worksheet Functions | |||
Count the contents in a cell | Excel Worksheet Functions |