So I have 2 functions that return a specific cell location in Excel. One for a start date and the other for the end date. Once I have these 2 dates I will create a range with them to fill it with a color. My current loop looks like this:
I am getting an error saying Type Mismatch highlighting the first function in the loop, BeginDate. I have rsLeave defined as a DAO.Recordset, and rownum as long. Not sure if it is referring to the actual function arguments:
Code:
Do While rsLeave.EOF = False
Set rRange = xlSh.Cells.Find(What:=rsLeave![DoD ID])
rownum = rRange.Row
startRange = ""
endRange = ""
BeginDate rsLeave![Start Date], rownum
FinDate rsLeave![End Date], rownum
With xlSh.range(startRange, endRange)
.Interior.ColorIndex = 4
End With
rsLeave.MoveNext
Loop
I am getting an error saying Type Mismatch highlighting the first function in the loop, BeginDate. I have rsLeave defined as a DAO.Recordset, and rownum as long. Not sure if it is referring to the actual function arguments:
Code:
Private Function BeginDate(rsLeave As DAO.Recordset, rownum) As String