ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   pick last item from a (variable) range (https://www.excelbanter.com/excel-programming/379182-pick-last-item-variable-range.html)

Gert

pick last item from a (variable) range
 
Hi all,

Is there a formula to pick the last item out of a (variable) range

thanks in advance
Gert


excel-ant

pick last item from a (variable) range
 
How do you mean pick

This piece of code will store and display the last cell in a selected
range(x)

Sub LastCell()

For Each cell In Selection
cell.Select: x = ActiveCell.Value
Next cell
MsgBox x

End Sub

http://www.excel-ant.co.uk


[email protected]

pick last item from a (variable) range
 

Gert wrote:
Hi all,

Is there a formula to pick the last item out of a (variable) range

thanks in advance
Gert


How about this:

x(x.Rows.Count, x.Columns.Count).Value

where x is your range?



All times are GMT +1. The time now is 03:34 PM.

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