Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If I select cells A1:K100, how do I count how many are blank.
Thank you, Steven |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub countblankcells()
'MsgBox Selection.SpecialCells(xlCellTypeBlanks).Count For Each c In range("a1:k10") 'Selection If Len(Application.Trim(c)) < 1 Then mc = mc + 1 Next c MsgBox mc End Sub -- Don Guillett Microsoft MVP Excel SalesAid Software "Steven" wrote in message ... If I select cells A1:K100, how do I count how many are blank. Thank you, Steven |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Don,
I would have thought the line you commented out would do it ('MsgBox Selection.SpecialCells(xlCellTypeBlanks).Count). Doesn't that work? I guess it's so you'd count cells with spaces in them as blanks, but I wonder if that's what Steven wants. Thanks, Doug "Don Guillett" wrote in message ... Sub countblankcells() 'MsgBox Selection.SpecialCells(xlCellTypeBlanks).Count For Each c In range("a1:k10") 'Selection If Len(Application.Trim(c)) < 1 Then mc = mc + 1 Next c MsgBox mc End Sub -- Don Guillett Microsoft MVP Excel SalesAid Software "Steven" wrote in message ... If I select cells A1:K100, how do I count how many are blank. Thank you, Steven |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I tried it a little and it seemed to work fine.
Doug "Don Guillett" wrote in message ... My testing showed that it didn't. Forgot to delete. -- Don Guillett Microsoft MVP Excel SalesAid Software "Doug Glancy" wrote in message ... Don, I would have thought the line you commented out would do it ('MsgBox Selection.SpecialCells(xlCellTypeBlanks).Count). Doesn't that work? I guess it's so you'd count cells with spaces in them as blanks, but I wonder if that's what Steven wants. Thanks, Doug "Don Guillett" wrote in message ... Sub countblankcells() 'MsgBox Selection.SpecialCells(xlCellTypeBlanks).Count For Each c In range("a1:k10") 'Selection If Len(Application.Trim(c)) < 1 Then mc = mc + 1 Next c MsgBox mc End Sub -- Don Guillett Microsoft MVP Excel SalesAid Software "Steven" wrote in message ... If I select cells A1:K100, how do I count how many are blank. Thank you, Steven |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Multiple cells or columns are selected instead of selected cell or | Excel Discussion (Misc queries) | |||
Test if entire row is selected | Excel Programming | |||
Test if cells are selected | Excel Programming | |||
Test to see if selected range is single row? | Excel Programming | |||
Macro to take selected cells times a selected cell | Excel Programming |