PDA

View Full Version : Solved: VBA to find last populated cell but ignore formulas returning blank



Hamond
08-18-2010, 03:52 AM
Hi,

I have the line below that finds the last populated cell in the column but I need it to ignore any cells that have a formula returning no value.

Range("A2000").End(xlUp).select

So for example, cells A1 to A6 contain a fomula that returns a value if a criteria is met and "" if it is not. When I run the code it takes me to cell A6 even though there is no value in it. I want the code to take me to the cell with the last populated value - cell A3.

A1 454
A2 475
A3 784
A4
A5
A6

Is this possible?

Thanks

Hamond

Bob Phillips
08-18-2010, 05:03 AM
Cells(Application.Evaluate("MAX(IF(A1:A2000<>"""",ROW(A1:A2000)),0,1)"), "A").Select

Hamond
08-25-2010, 03:37 AM
Thanks XLD

I've tested this out and gives me what I need.