![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Apr 2002
Posts: 210
|
I'm using the following macro but it's not catching the empty cells. Any thoughts???
Sub selectusedrange3() empties = 0 For Each y In ActiveSheet.Range("a:a") If y.Value = " " Then empties = empties + 1 End If Next y ccountmsg = "TOTAL EMPTY CELLS = : " & empties MsgBox ccountmsg, , "EMPTY CELLS - proceed" |
|
|
|
|
|
#2 |
|
Board Regular
Join Date: Mar 2002
Location: =ActiveCell.Address
Posts: 478
|
I think if you want to count empty cells you need "", not " ". The latter would count cells with just a space in. N.B. There is the Excel function COUNTBLANK |
|
|
|
|
|
#3 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Monterrey, Mexico
Posts: 1,433
|
Replace y.Value = " " with y.Value = ""
__________________
Kind regards, Al Chara |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|