I am having problems with the following "NETWORKDAYS" code. I get a Type mismatch during run-time.
Equally important, the second date in the NETWORKDAYS statement, "G2", needs to be variable such as i for the row and an offset into an array as the column (I have the array built and use it elsewhere successfully).
Thanks so much...
i = 2
Do
With Range("A" & i)
Select Case .Value
Case "" 'Do nothing
Case "Comments:", "Description:"
i = i + 1
Case Else:
Select Case Evaluate("NETWORKDAYS(Now(),G2)")
Case Is < 1
OIRGroupCount(2) = OIRGroupCount(2) + 1
Case Is <= Sheets("Lists").Cells(RptDueDate(RptDueDateR1), RptDueDate(RptDueDateC1))
OIRGroupCount(1) = OIRGroupCount(1) + 1
End Select
End Select
End With
i = i + 1
Loop Until i > Sheets(ReportName).Cells(Rows.Count, 1).End(xlUp).Row
Equally important, the second date in the NETWORKDAYS statement, "G2", needs to be variable such as i for the row and an offset into an array as the column (I have the array built and use it elsewhere successfully).
Thanks so much...
i = 2
Do
With Range("A" & i)
Select Case .Value
Case "" 'Do nothing
Case "Comments:", "Description:"
i = i + 1
Case Else:
Select Case Evaluate("NETWORKDAYS(Now(),G2)")
Case Is < 1
OIRGroupCount(2) = OIRGroupCount(2) + 1
Case Is <= Sheets("Lists").Cells(RptDueDate(RptDueDateR1), RptDueDate(RptDueDateC1))
OIRGroupCount(1) = OIRGroupCount(1) + 1
End Select
End Select
End With
i = i + 1
Loop Until i > Sheets(ReportName).Cells(Rows.Count, 1).End(xlUp).Row