View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
[email protected] cmtinker@gmail.com is offline
external usenet poster
 
Posts: 2
Default sorting w/ errors

I'm trying to sort a column that contains a formula and some of the
values contain an error. Of course, when I sort descending (which is
what I need) I get the error values first and then the data that I
need under it. I need to check to find the first value in the column
that isn't an error value but can't figure out how to evaluate if a
cell actually has an error in it

I've tried

While Sheet1.Cells(sheet1row, 21).Value < ""

While Sheet1.Cells(sheet1row, 21).Value = xlErrNA

and in all cases incrementing sheet1row but always receive a mismatch
error

I also tried sorting ascending and trying this check

While Sheet1.Cells(sheet1row + 1, 21).Value = Sheet1.Cells(sheet1row,
21).Value And Sheet1.Cells(sheet1row + 1, 21).Value < xlErrNA

but that didn't work either

does anyone have any ideas? I'd greatly appreciate it