Hi fellow VBA lovers,
I would love a solution to help me do the follow:
'Sort' (i.e. push all applicable rows of data which match my criteria to the top of a list, as opposed to just filtering out the irrelevant dates) a list of scheduled courses to the top of my data set based on a date range ('start' and 'end' dates) in Excel 2010. The dates will be provided by the user via an 'Input box' which will pop up at the start when the code is run.
It would be great if the sorted data could be copied and pasted into a new worksheet called 'sorted data'. Tall order but I would be massively grateful of a solution. Cheers
Sample In-Put box:
[TABLE="class: grid, width: 191"]
[tr]
[TD="colspan: 2"]Please enter the data range your wish to sort by?:
[/TD]
[/tr]
[tr]
[td]
Date range 'Start'
[/td]
[td]
Date range 'End'
[/td]
[/tr]
[tr]
[td]
10/08/2014 09:00
[/td]
[td]
14/08/2014 09:30
[/td]
[/tr]
[/TABLE]
- My data starts in Cell A5
- The table headers are in row 4
- My data table has 32 colums
- and 'X' number of rows (usually about 3,000)
An example of my data is below 'dates' to sort by will be present in column B.
[TABLE="class: grid, width: 719, align: left"]
[tr]
[td]
UID ID
[/td]
[td]
Start Date
[/td]
[td]
Last Date
[/td]
[td]
Course UID
[/td]
[td]
Course Title
[/td]
[td]
Status
[/td]
[/tr]
[tr]
[td]
100909
[/td]
[td]
10/08/2014 09:00
[/td]
[td]
19/08/2014 17:00
[/td]
[td]
JPCVBA
[/td]
[td]
VBA for complete novice
[/td]
[td]
Cancelled
[/td]
[/tr]
[tr]
[td]
100908
[/td]
[td]
12/08/2014 09:30
[/td]
[td]
11/08/2014 12:30
[/td]
[td]
JPCMIR
[/td]
[td]
Baking in the Microwave
[/td]
[td]
Active
[/td]
[/tr]
[tr]
[td]
100907
[/td]
[td]
14/08/2014 09:30
[/td]
[td]
12/08/2014 17:30
[/td]
[td]
JPCPLU
[/td]
[td]
Plumbing 101
[/td]
[td]
Cancelled
[/td]
[/tr]
[tr]
[td]
100906
[/td]
[td]
02/08/2014 09:30
[/td]
[td]
14/08/2014 17:30
[/td]
[td]
JPCDIY
[/td]
[td]
DIY for the accident prone
[/td]
[td]
Active
[/td]
[/tr]
[tr]
[td]
100905
[/td]
[td]
25/08/2014 09:30
[/td]
[td]
14/08/2014 17:30
[/td]
[td]
JPCCHA
[/td]
[td]
How to dance the cha-cha-cha
[/td]
[td]
Cancelled
[/td]
[/tr]
[tr]
[td]
100902
[/td]
[td]
18/08/2014 09:30
[/td]
[td]
14/08/2014 17:30
[/td]
[td]
JPCDIY
[/td]
[td]
DIY for the accident prone
[/td]
[td]
Active
[/td]
[/tr]
[/TABLE]