I am receiving an object required error on the following line within the context below. The variable StartDate is a Date data type. I would like for RngStart to be a Range value that I can plug in to the line:
The line immediately below is generating the error:
Code:
ActiveChart.SetSourceData Source:=Sheets("ActiveSheet").Range(RngStart, RngEnd)
The line immediately below is generating the error:
Code:
Set RngStart = Cells.Find(What:=StartDate, After:=ActiveCell, LookIn:=xlFormulas, _ LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Select
Code:
Dim aa As IntegerDim StartDate As Range
Dim EndDate As Range
Dim RngStart As Range
Dim RngEnd As Range
For aa = 5 To 24
ActiveWorkbook.Sheets("AllDistanceMeasures").Activate
Set StartDate = Cells(aa, 9)
Set EndDate = Cells(aa, 10)
ActiveWorkbook.Sheets("ActiveSheet").Activate
Set RngStart = Cells.Find(What:=StartDate, After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Select