How to select specific data from workbook based on value

JamesCage

New Member
Joined
May 9, 2014
Messages
1
HI Everyone,

I need to select the past 12 months of data from the H column in a workbook. A new row of data gets added every month. I need code that recognizes the most recent input and also selects the first 11 cells above containing data.

Thanks for any help
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
Maybe like this

Code:
Sub test()
Dim LR As Long
LR = Range("H" & Rows.Count).End(xlUp).Row
Range("H" & LR).Offset(-11).Resize(12).Select
End Sub
 
Upvote 0
Welcome to the Board!

A pivot table comes to mind.

What do you need to do once you've selected those rows?

It'll help if you post a shot of your sheet (see the HTML Maker link in my sig for how).
 
Upvote 0

Forum statistics

Threads
1,216,099
Messages
6,128,820
Members
449,469
Latest member
Kingwi11y

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