I am writing a timeline with the idea to populate the timeline with events from start date to end date of an event.
I have my dates starting from "E19" all the way to "RU19" (the end date column can be arbitrary. The dates are from 03-Apr-2016 to 31-Jul-2017.
Events have 3 columns:
- Start date: A22
- End date: B22
- Event name: C22
I set up a range from "E19" to last column of the document "RU19". Is it possible to set a subrange based on cell values that would iterate through the main range and return the value from start to end of the subrange?
So for example if my subrange start date in cell A22 is 05-Apr-2016 and end date in cell B22 is 08-Apr-2016 I would select a subrange "G19:J19".
Current code is:
Dim LastCol As Long
Dim startDate As Range
'find last column in the document
LastCol = Cells(19, Columns.Count).End(xlToLeft).Column
'set timeline range from start of date data to last column
Set startDate = Range(Cells(19, 5), Cells(19, LastCol))