Sub SelectRange ()
Dim StartCell as Range, EndCell as Range
If Len(Range("A1")) > 0 Then
Set StartCell = Range("A1")
Else
Set StartCell = Range("A1").End(xlDown)
End If
Set EndCell = Range("A" & Rows.Count).End(Xlup)
If StartCell.Row = EndCell.Row Then StartCell.Select
If StartCell.Row > EndCell.Row Then
MsgBox "Valid range not available"
Else
Range(StartCell, EndCell).Select
End If
End Sub