View Full Version : Help vba code for a formula in two cells

02-06-2016, 05:30 AM
Hi Friends,

I have a sheet where I need a formula(as below) to be inserted in the in column "B" and "C" using a vba code.

Column B = NETWORKDAYS(A2,$D$2)-1
Column C = =IF(B2>90,">90 Days",(IF(B2<6,"0-5 Days",IF(B2<31,"6-30 Days",IF(B2<91,"31-90 Days")))))

Attached sheet for your reference.


Data in column A and D will change every month.

Request your help on this.

02-06-2016, 06:56 AM
Range.Formula = Complete Formula in Quotes

Range("A1").Formula = "=Sum(B1,B2)"