This is a followup question to this one.
The following formula can be used to find the value of the last non-empty cell in a column, in Microsoft Excel:
=LOOKUP(2,1/(A:A<>""),A:A) My question is, how can I convert this formula to a Macro function? So that I can use it like this:
=GetLastValueInColumn('A') Indeed, I need to convert the letter 'A' to range A:A, but don't know how.
Range("A" & Rows.Count).End(xlUp).Valueis probably what you're looking for.