dynamic range issues

ajc5382

New Member
Joined
Jun 25, 2012
Messages
41
Hello all,

I'm in a bit of a situation and since the members of this forum have been extremely helpful, I figured this was a go to for a question such as this. I currently have a query coded that pulls data from a 3rd party. I have a from date that retrieves data until present. What I need to do next is find a way to split up this data into increments of my choosing. For example, if the data is from 1/1/2011 till present, I want to be able to have data split for 2011 on one worksheet, and data from 2012 on another. If possible, i'd like this to be as flexible so that I can do things such as analyze, say august-September of 2011 on one sheet, and the same on another for 2012.

Anything so much as a nudge in the right direction would be a big help!

Thanks
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Without doing a macro you could try this ~

Say your dates are in column A, starting at cell A5, in your first spare column say its column V in cell V5 enter ~ =YEAR(A5)
Filter by column V ~ 2011, While a cell inside your data is selected press CTRL + a,(select all) click copy, select
the sheet to paste to, select the cell you wish to start the data at and click paste.

If you wish to narrow down your filter by month or week or day, use =Month(A5) or =WEEKNUM(A5) or =DAY(A5)

Cheers, hope this is of some help.
 
Upvote 0
All of this is being written in code to make it as user friendly as possible. Do you perhaps know a way to add a TODATE into function into this mix. What I ultimately want is a from and to date in my userform to limit the data range.
 
Upvote 0

Forum statistics

Threads
1,213,546
Messages
6,114,251
Members
448,556
Latest member
peterhess2002

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