Type mismatch

Rocky0201

Active Member
Joined
Aug 20, 2009
Messages
278
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
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.

Forum statistics

Threads
1,215,453
Messages
6,124,930
Members
449,195
Latest member
Stevenciu

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top