Forum Discussion
mtthomasm516
Oct 30, 2023Copper Contributor
Count Black Cells In a Range Using VBA
I am trying to count blank cells in a range using VBA. Below is an abbreviated version of my code. The full macro contains more, but I figured all that is irrelevant at this point since it chokes o...
- Oct 31, 2023
MJkuyet
Nov 25, 2024Copper Contributor
Hi,
I think you forgot to set range for Current_Task
check this; maybe
Public Sub counterer()
'I declare theRange as range
Dim theRange As Range
'I then assign the range of cells to my variable
Set theRange = Range("A2:B11")
'I the return the number of blank in an active cell on my excel
ActiveCell.Value = WorksheetFunction.CountBlank(theRange)
End Sub