XLUP maybe...

Wes

Board Regular
Joined
Jan 30, 2004
Messages
195
Hi all,

I'm needing to get the last value in a column (range L14 to L34) and then put that value into a specific cell (L7).

I tried the .xlup method but only had the cursor go to the last vacant cell in the range.

Any help would really be appreciated.

Thanks,
Wes
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Hi There

I looked up my desk reference and found

Code:
Nextrow = Application.WorksheetFunction.CountA(Range("A:A"))+1


Hope it helps


Dave
 
Upvote 0
Thanks dave3009

I got her. I apparently was a little too hastey and add a bit too much to the string which made it stop at the first empty cell not the last one with information.
For future:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Range("L7") = Range("L34").End(xlUp)
End Sub

This is the end result.

Cheers

Wes
 
Upvote 0
Why VBA? How about a formula?
What kind of data is in the range L14 to L34, text or numeric?

If text:
In L7:
=LOOKUP(REPT("z",255),L14:L34)

If numeric,
In L7:
=LOOKUP(9.99999999999999E+307,L14:L34)

If mixed, perhaps:
In L7:
=LOOKUP(9.99999999999E+307,1/(L14:L34<>""),L14:L34)
Confirm with CTRL-SHIFT-ENTER rather than just Enter.
 
Upvote 0
Why VBA? How about a formula?
What kind of data is in the range L14 to L34, text or numeric?

If text:
In L7:
=LOOKUP(REPT("z",255),L14:L34)

If numeric,
In L7:
=LOOKUP(9.99999999999999E+307,L14:L34)

If mixed, perhaps:
In L7:
=LOOKUP(9.99999999999E+307,1/(L14:L34<>""),L14:L34)
Confirm with CTRL-SHIFT-ENTER rather than just Enter

Excellent ! thanks for the info ;)
 
Upvote 0

Forum statistics

Threads
1,214,978
Messages
6,122,549
Members
449,089
Latest member
davidcom

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top