ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   sorting w/ errors (https://www.excelbanter.com/excel-programming/391158-sorting-w-errors.html)

[email protected]

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


Tom Ogilvy

sorting w/ errors
 
While Sheet1.Cells(sheet1row, 21).Value = cverr(xlErrNA)


--
Regards,
Tom Ogilvy


" wrote:

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



[email protected]

sorting w/ errors
 
thank you!



All times are GMT +1. The time now is 06:17 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com