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
 
So, there's not blank lines in between entries? Then why are you using repeated xlUp? It sounds like you just need to step backwards through the list.
Code:
Sub test()
Dim x As Long, r As Long
r = 1
For x = Range("B" & Rows.Count).End(xlUp).Row To 2 Step -1
    r = r + 1
    Range("F" & r) = Range("B" & x)
Next
End Sub
 
Upvote 0

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop

Forum statistics

Threads
1,216,115
Messages
6,128,919
Members
449,478
Latest member
Davenil

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