Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Public Function ReturnEmptyCells(AnyCellInRange As Range) As String
Dim MyRange As Range
Dim MyRow As Range, MyColumn As Range
Dim lngBlankRow As Long, lngBlankColumn As Long
Dim lngCounter As Long
Set MyRange = Worksheets(AnyCellInRange.Worksheet.Name).UsedRange
'Find blank rows
For Each MyRow In MyRange.Rows
lngCounter = 0
For Each MyColumn In MyRow.Columns
If MyColumn.Value = "" Then
lngCounter = lngCounter + 1
End If
Next MyColumn
If lngCounter = MyRow.Columns.Count Then
lngBlankRow = lngBlankRow + 1
End If
Next MyRow
'Find blank columns
For Each MyColumn In MyRange.Columns
lngCounter = 0
For Each MyRow In MyColumn.Rows
If MyRow.Value = "" Then
lngCounter = lngCounter + 1
End If
Next MyRow
If lngCounter = MyColumn.Rows.Count Then
lngBlankColumn = lngBlankColumn + 1
End If
Next MyColumn
Set MyRow = Nothing
Set MyColumn = Nothing
Set MyRange = Nothing
ReturnEmptyCells = "Blank Rows: " & lngBlankRow & "," & "Blank Columns: " & lngBlankColumn
End Function