Hi, I found a formula here to return 0 (zero) when the start date = the end date but having trouble getting it to work in VBA.
Here's what I have:
Dim ws As Worksheet
Dim lr As Long
Set ws = Sheets("Sheet1")
lr = ws.Cells(Rows.Count, "A").End(xlUp).Row
ActiveCell.FormulaR1C1 = "=IF(INT(I2)=INT(Today()),0,NETWORKDAYS(I2,Today()))"
Selection.AutoFill Destination:=Range("L2:L" & lr)
'What I get in Cell L2 has single quotes added to the Cell Reference:
Also, the autofill isn't working the way I wanted as I get L2 in row 3, 4, 5, etc.
Thanks in advance,