Last row w/ non-null result of formula

W

wpiet

I know how to use the End(xlUp) property to find the last row with data.
However, I have a sheet full of formulas which return either a value or NULL.
Using End(xlUp) returns the last row containing anything, including formulas.
How do I find the last row that contains NON-NULL VALUES resulting from
these formulas.

For example, I have 20 rows with formulas in them.
Only the first "x" rows have non-null values resulting from these formulas.
The remaining (20 - "x") rows contain the formulas but they return null
values.
How do I determine the value of "x"?
 
R

Rick Rothstein

You could use this...

LastRowWithValue = ActiveSheet.Range("A:A").Find(What:="*", _
SearchDirection:=xlPrevious, Lookin:=xlValues, _
SearchOrder:=xlColumns).Row

where you can swap out ActiveSheet for a specific worksheet using, as an
example, Worksheets("Sheet1"); and change the column references within the
Range function call.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top