Macro Code to Select All Non Blank Cells

Sub NonBlankCells()
'Macro Code to Select All Non Blank Cells
    On Error Resume Next
    Union(Cells.SpecialCells(xlCellTypeFormulas, 23), Cells.SpecialCells(xlCellTypeConstants, 23)).Select
    If Err.Number <> 0 Then
        Cells.SpecialCells(xlCellTypeFormulas, 23).Select
    Else
        Exit Sub
    End If
    If Err.Number <> 0 Then
        Cells.SpecialCells(xlCellTypeConstants, 23).Select
    Else
        Exit Sub
    End If
    On Error GoTo 0
End Sub

Comments

Popular posts from this blog

TDS Calculation System

VBA - Additional Controls Dialog Box "MISSING"

Loan EMI Calculator Dashboard