Cell value from using XLUP

Wes

Board Regular
Joined
Jan 30, 2004
Messages
195
Hello All,

I have a task pertaining to getting a value into a cell using XLUP.
What I'm trying to do is column B contains a list of items. Using XLUP id like to find the last value in column B and place it in D2. Then in D3 that value would be the second value up from the first value found in column B using XLUP.

Any help would be really appreciated.

Thanks

Wes
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Hey Scott,

That works now. However how do we include B6 etc ...

I guess its just a reverse of column B into Column F as entries are added to Column B
 
Upvote 0
Sure Rick, what's the email to link to in Dropbox?
DropBox is a well-vetted, safe website for posting files. Its URL is...

www.dropbox.com

You set up a free account, post the file, mark it for sharing (I think) and then post the URL that they give you for the file in a reply message here.
 
Upvote 0
Code:
Sub test()
Dim c As Range, r As Long
r = 2
Range("F:F").ClearContents
Set c = Range("B" & Rows.Count).End(xlUp)
Range("F" & r) = c
Do Until c.Row = 1
    Set c = c.End(xlUp)
    r = r + 1
    Range("F" & r) = c
Loop
End Sub
 
Upvote 0
Hello Scott,

I does work however it only swaps the very first cell (B1) in the column and the very last cell. I will be running more entries in the column so need something to consider everything in that column.

I hope that makes a little sense,
 
Upvote 0
Hello Scott,

I does work however it only swaps the very first cell (B1) in the column and the very last cell. I will be running more entries in the column so need something to consider everything in that column.

I hope that makes a little sense,

Not sure what you mean. I did post revised code. See Post 15 in this thread.
 
Last edited:
Upvote 0
Ok, it seem to work if in column B there is a blank cell in between every entry. So B2, B4 etc have to be blank with values in B1, B3 etc then it works perfectly creating a reverse list in column F.
 
Upvote 0

Forum statistics

Threads
1,223,898
Messages
6,175,272
Members
452,628
Latest member
dd2

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