Finding the end of Data
Maybe it's not important to find the last row.
If you don't have any other errors in that column and these errors are constants
(not formulas), you could do the equivalent of:
Selecting the column
Then hit F5 (edit|goto)|special|constants|and select only errors
In code, it would look like:
Option Explicit
Sub testme()
Dim myErrorRng As Range
Dim wks As Worksheet
Set wks = ActiveSheet
With wks
Set myErrorRng = Nothing
On Error Resume Next
Set myErrorRng = .Range("F:F") _
.Cells.SpecialCells(xlCellTypeConstants, xlErrors)
On Error GoTo 0
If myErrorRng Is Nothing Then
MsgBox "No cells with constant errors in them"
Else
myErrorRng.EntireRow.Select '.delete????
End If
End With
End Sub
If the #n/a's were the results of formulas, you could use xlcelltypeformulas
instead.
Jim Berglund wrote:
I have a data set that has a sorted column filled with either numbers or
"#N/A" (which are all found above the numbers)
I want to select the rows that have "#N/A" in them. How to I find the last
row, please?
Jim Berglund
--
Dave Peterson
|