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.
Function FirstNonBlank(rng As Range) As Long
Dim lRowCount As Long, iColCount As Integer
With rng
lRowCount = .Rows.Count
iColCount = .Columns.Count
If lRowCount > 1 And iColCount = 1 Then
If IsEmpty(Cells(.Row, .Column).Value) Then
FirstNonBlank = Cells(.Row, .Column).End(xlDown).Row
Else
FirstNonBlank = Cells(.Row, .Column).Row
End If
Exit Function
End If
If lRowCount = 1 And iColCount > 1 Then
If IsEmpty(Cells(.Row, .Column).Value) Then
FirstNonBlank = Cells(.Row, .Column).End(xlToRight).Column
Else
FirstNonBlank = Cells(.Row, .Column).Column
End If
Exit Function
End If
FirstNonBlank = 0
End With
End Function