excel - Networkdays in VBA for a range of dates -


i'm trying run code in vba checks 2 column full of start dates , end dates , fills in 3rd column corresponding workdays between dates.

for = 2 n cells(i, f) = application.networkdays(c, d)  next 

above have tried already. cant show n in case function finds end of imported data (that works). application defined error. if remove application. says networkdays not defined sub or function.

for = 2 50 cells(i, "f") = application.networkdays("c", "d") next 

if run above populates 3rd column #value (50 being example n)

for = 2 50 cells(i, "f") = application.networkdays(c, d) next 

if run above column full of 0.

how can work? seems simple yet vba seems programmed make impossible! same issue on excel 2013, 2010 , 2016

you need go row row in formula.

cells(i, "f") = application.networkdays(cells(i, "c"), cells(i, "d")) 

Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -